diff options
author | monsta <[email protected]> | 2017-02-07 20:48:02 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-02-16 18:01:04 +0300 |
commit | 12b88c9a9ad18bb9a6d5c9d49d61895b248dd3a0 (patch) | |
tree | 127b2c1cf5b65fa26ed330f1ca4dbf61e5b814f3 /drivemount | |
parent | 66bfbc8094edf867b65ab9c575d1aa085b43daaf (diff) | |
download | mate-applets-1.16.tar.bz2 mate-applets-1.16.tar.xz |
drivemount: fix runtime warnings with GTK+ 3.20/221.16
use modern padding and margin properties to fix deprecation warnings
use zero border width to fix negative allocation warning
and set widget name to make it actually work
Diffstat (limited to 'drivemount')
-rw-r--r-- | drivemount/drive-button.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c index 8be9d02b..0e6f162f 100644 --- a/drivemount/drive-button.c +++ b/drivemount/drive-button.c @@ -74,13 +74,25 @@ drive_button_class_init (DriveButtonClass *class) GtkCssProvider *provider; provider = gtk_css_provider_new (); + +#if GTK_CHECK_VERSION (3, 20, 0) + gtk_css_provider_load_from_data (provider, + "#drive-button {\n" + " border-width: 0px;\n" + " padding: 0px;\n" + " margin: 0px;\n" + "}", + -1, NULL); +#else gtk_css_provider_load_from_data (provider, - "DriveButton {\n" + "#drive-button {\n" " border-width: 0px;\n" " -GtkWidget-focus-line-width: 0px;\n" " -GtkWidget-focus-padding: 0px;\n" "}", -1, NULL); +#endif + gtk_style_context_add_provider_for_screen (gdk_screen_get_default(), GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); @@ -118,6 +130,10 @@ drive_button_init (DriveButton *self) self->update_tag = 0; self->popup_menu = NULL; + +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_name (GTK_WIDGET (self), "drive-button"); +#endif } GtkWidget * |