Skip to content


clock: force no button vertical padding and margin
Browse files Browse the repository at this point in the history
fixes weather-icon problems with some themes
  • Loading branch information
raveit65 committed Dec 29, 2018
1 parent 422f7e5 commit 4c23197
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions applets/clock/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,15 +1273,17 @@ clock_update_text_gravity (GtkWidget *label)

static inline void
force_button_negative_margin (GtkWidget *widget)
force_no_button_vertical_padding (GtkWidget *widget)
GtkCssProvider *provider;

provider = gtk_css_provider_new ();
gtk_css_provider_load_from_data (provider,
"#clock-applet-button.flat.toggle > box.horizontal > box.horizontal > image {\n"
"margin-top: -4px;\n"
"margin-bottom: -4px;\n"
"#clock-applet-button {\n"
"padding-top: 0px;\n"
"padding-bottom: 0px;\n"
"margin-top: 0px;\n"
"margin-bottom: 0px;\n"
-1, NULL);
gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
Expand All @@ -1301,7 +1303,7 @@ create_main_clock_button (void)
button = gtk_toggle_button_new ();
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);

force_button_negative_margin (button);
force_no_button_vertical_padding (button);

return button;
Expand Down

0 comments on commit 4c23197

Please sign in to comment.