diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-02-24 11:20:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-02-24 14:03:46 +0100 |
commit | 982c8bfce565bc2e2c3802924ec73e9d247044f2 (patch) | |
tree | 69550935f1adbf8eca1ceb17da2ec74eb44c24a7 | |
parent | 22ad4d69d771708f28a2d9e137cfd43ac846cf3a (diff) |
set the state on the widget instead of the context to get it to stick
Change-Id: I76f7487957d38f155ea086fd01855149ad170166
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89339
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index fe3cd37ba8af..0875bb071251 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -7536,11 +7536,10 @@ public: find_menupeer_button(GTK_WIDGET(pToolButton), &pButton); if (pButton) { - GtkStyleContext *pWidgetContext = gtk_widget_get_style_context(GTK_WIDGET(pButton)); - auto eState = gtk_style_context_get_state(pWidgetContext) & ~GTK_STATE_FLAG_CHECKED; + auto eState = gtk_widget_get_state_flags(GTK_WIDGET(pButton)) & ~GTK_STATE_FLAG_CHECKED; if (bActive) eState |= GTK_STATE_FLAG_CHECKED; - gtk_style_context_set_state(pWidgetContext, static_cast<GtkStateFlags>(eState)); + gtk_widget_set_state_flags(GTK_WIDGET(pButton), static_cast<GtkStateFlags>(eState), true); } } else if (GTK_IS_TOGGLE_TOOL_BUTTON(pToolButton)) @@ -7562,8 +7561,7 @@ public: find_menupeer_button(GTK_WIDGET(pToolButton), &pButton); if (pButton) { - GtkStyleContext *pWidgetContext = gtk_widget_get_style_context(GTK_WIDGET(pButton)); - return gtk_style_context_get_state(pWidgetContext) & GTK_STATE_FLAG_CHECKED; + return gtk_widget_get_state_flags(GTK_WIDGET(pButton)) & GTK_STATE_FLAG_CHECKED; } } else if (GTK_IS_TOGGLE_TOOL_BUTTON(pToolButton)) |