Re: GTK+ Theming improvements

Mathias Hasselmann <[email protected]>
Newsgroups gmane.comp.gnome.gtk+.devel.general,gmane.comp.gnome.themes
Organization http://taschenorakel.de/
Message-ID <1188657134.7139.12.camel@localhost>
Why not use the most obvious solution for the problem: Keep the theming
engine as is, but instead of using one single theming detail string,
let's attach a theming class property in the spirit of CSS class names
to widgets:

    const gchar** gtk_widget_get_style_classes (GtkWidget *widget);

    gboolean gtk_widget_has_style_class (GtkWidget   *widget,
				         const gchar *class_name);

Well, or for optimal speed let's use GQuarks instead:

    const GQuark* gtk_widget_get_style_classes (GtkWidget *widget);

    gboolean gtk_widget_has_style_class (GtkWidget *widget,
				         GQuark     class_name);

Now let's add the rule, that widgets have to provide a macro for each
style class they define, and we even get some easy way to document style
classes:

    #define GTK_STYLE_CLASS_TREE_VIEW_COLUMN_BUTTON \
            gtk_style_class_tree_view_column_button_get_quark ()

You might argue defining quarks for this purpose is quite some effort,
but Bugzilla and libegg contain the implementation of a G_DEFINE_QUARK,
respectively EGG_DEFINE_QUARK marco declaring *_get_quark functions:

    G_DEFINE_QUARK (GtkStyleClassTreeViewColumnButton,
                    gtk_style_class_tree_view_column_button);

This approach might not be a big and final solution, but its an approach
that can be implemented right now without breaking much stuff.


Ciao,
Mathias
-- 
Mathias Hasselmann <[email protected]>
http://taschenorakel.de/

_______________________________________________
gtk-devel-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-devel-list
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBG2Xfu73AS0G6kpDQRAor0AJ9rflEgfK+Y7ZIr6kWnyGTZM4OTRwCeI2wT
b1J/Hrgg1S3ccWa4nRVoGU4=
=RVI+
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.