summaryrefslogtreecommitdiff
path: root/drivemount
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-02-07 20:48:02 +0300
committermonsta <[email protected]>2017-02-07 20:48:55 +0300
commitac0ae423c0f5d3f9e7aa4b7e473cade399d2d97d (patch)
tree37a8482cbe4d9240dbcc3adfdcbd5e7aefd76e4f /drivemount
parentd6b198221c3d85c41ee38dd00aac6a7614376e27 (diff)
downloadmate-applets-ac0ae423c0f5d3f9e7aa4b7e473cade399d2d97d.tar.bz2
mate-applets-ac0ae423c0f5d3f9e7aa4b7e473cade399d2d97d.tar.xz
drivemount: fix runtime warnings with GTK+ 3.20/22
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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c
index d3fd2d58..2408eec7 100644
--- a/drivemount/drive-button.c
+++ b/drivemount/drive-button.c
@@ -71,13 +71,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);
@@ -99,6 +111,8 @@ drive_button_init (DriveButton *self)
self->update_tag = 0;
self->popup_menu = NULL;
+
+ gtk_widget_set_name (GTK_WIDGET (self), "drive-button");
}
GtkWidget *