• Colomban Wendling's avatar
    Fix our custom styles under KDE and for people using gtk-chtheme · 232290aa
    Colomban Wendling yazdı
    We have a custom RC file defining various styles we need, and we want
    the user to be able to override them (e.g. if they want -- or need --
    other colors).  Fair enough, one would simply call gtk_rc_parse() with
    the appropriate filename.  However, the styling rules applies in the
    order they are loaded, then if we load our styles after GTK has loaded
    the user's ones we'd override them.
    
    There are 2 solutions to fix this:
    1) set our styles' priority to something with lower than "user"
       (actually "theme" priority because rules precedence are first
       calculated depending on the priority no matter of how precise the
       rules is, so we need to override the theme).
    2) prepend our custom style to GTK's list while keeping priority to
       user (which is the default), so it gets loaded before real user's
       ones and so gets overridden by them.
    
    One would normally go for 1 because it's ways simpler and requires less
    code: you just have to add the priorities to your styles, which is a
    matter of adding a few ":theme" in the RC file.  However, KDE being a
    bitch it doesn't set the gtk-theme-name but rather directly includes
    the style to use in a user gtkrc file, which makes the theme have
    "user" priority, hence overriding our styles.  So, we cannot set
    priorities in the RC file if we want to support running under KDE,
    which pretty much leave us with no choice but to go with solution 2,
    which unfortunately requires writing ugly code since GTK don't have a
    gtk_rc_prepend_default_file() function.  Thank you very much KDE.
    
    Though, as a side benefit it also makes the code work with people using
    gtk-chtheme, which also found it funny to include the theme in the user
    RC file.
    232290aa
Adı
Son kayıt (commit)
Son güncelleme
data Loading commit data...
doc Loading commit data...
icons Loading commit data...
m4 Loading commit data...
plugins Loading commit data...
po Loading commit data...
scintilla Loading commit data...
scripts Loading commit data...
src Loading commit data...
tagmanager Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
COMMITTERS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
ChangeLog.pre-0-17 Loading commit data...
ChangeLog.pre-1-22 Loading commit data...
HACKING Loading commit data...
INSTALL Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
README.I18N Loading commit data...
README.Packagers Loading commit data...
THANKS Loading commit data...
TODO Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
geany.desktop.in Loading commit data...
geany.exe.manifest Loading commit data...
geany.gladep Loading commit data...
geany.nsi Loading commit data...
geany.pc.in Loading commit data...
geany.spec.in Loading commit data...
geany_private.rc Loading commit data...
makefile.win32 Loading commit data...
waf Loading commit data...
win32-config.h Loading commit data...
wscript Loading commit data...