Skip to content

Instantly share code, notes, and snippets.

@M4he
Created March 29, 2023 19:34
Show Gist options
  • Save M4he/2df2accc509ea8a80640f8cbc5129397 to your computer and use it in GitHub Desktop.
Save M4he/2df2accc509ea8a80640f8cbc5129397 to your computer and use it in GitHub Desktop.
PCManFM-Qt QSS fix for discolored PathBar when using the Breeze Qt5 style
// Add this as a .qss file to "Style Sheets" in qt5ct
//
// Notes:
// PathBar is within the Fm C++ namespace, see:
// https://github.com/lxqt/libfm-qt/blob/abd4aaa91c44d8141cdcc04972b906e10285a52f/src/pathbar.cpp#L36
// https://doc.qt.io/qt-5/stylesheet-syntax.html#widgets-inside-c-namespaces
Fm--PathBar QScrollArea, Fm--PathBar .QWidget {
background: transparent;
}
@M4he
Copy link
Author

M4he commented Mar 29, 2023

This fixes the PathBar background being white instead of the window's color when using the Breeze Qt5 style:

pcmanfm-qt_discolor-fix
(top: native PCManFM-Qt behavior, bottom: fixed QSS styling)

How to apply:

NOTE: this requires qt5ct being installed and QT_QPA_PLATFORMTHEME=qt5ct being set - it does not work with LXQt's native styling engine (which is QT_QPA_PLATFORMTHEME=lxqt)!
See here for more context.

  1. open up qt5ct
  2. switch to the Style Sheets tab
  3. click on Create
  4. name the file something like pcmanfm-qt-pathbar-fix.qss
  5. select the newly created entry and click Edit
  6. paste the code from above, click Save, then OK
  7. tick the checkmark left of the new entry and click Apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment