aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColomban Wendling <ban@herbesfolles.org>2016-04-27 16:01:17 +0200
committerColomban Wendling <ban@herbesfolles.org>2016-04-27 16:01:17 +0200
commit047e8f1f79ff4393f839dcfb4e9a6334a99e2e26 (patch)
tree2ea8535809e37ed2369e090cd8bb376106ef915d
parent77c31b70c5af50ceabe8728e1d80069226f2b199 (diff)
downloadscintilla-mirror-047e8f1f79ff4393f839dcfb4e9a6334a99e2e26.tar.gz
GTK: Get border for the exact current style's state on GTK 3
GTK 3.20 doesn't seem to like it so much when looking up details of a non-exact current style context state, so use the current one. This is GTK being really picky as in this case we are just missing the `DIR_LTR` flag, which we definitely don't care about, but let's make it happy.
-rw-r--r--gtk/PlatGTK.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 11aff4313..1b7f8c3bd 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -1550,9 +1550,10 @@ PRectangle ListBoxX::GetDesiredRect() {
int row_height = GetRowHeight();
#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *styleContextFrame = gtk_widget_get_style_context(PWidget(frame));
+ GtkStateFlags stateFlagsFrame = gtk_style_context_get_state(styleContextFrame);
GtkBorder padding, border, border_border = { 0, 0, 0, 0 };
- gtk_style_context_get_padding(styleContextFrame, GTK_STATE_FLAG_NORMAL, &padding);
- gtk_style_context_get_border(styleContextFrame, GTK_STATE_FLAG_NORMAL, &border);
+ gtk_style_context_get_padding(styleContextFrame, stateFlagsFrame, &padding);
+ gtk_style_context_get_border(styleContextFrame, stateFlagsFrame, &border);
# if GTK_CHECK_VERSION(3,20,0)
// on GTK 3.20 the frame border is in a sub-node "border".
@@ -1564,7 +1565,7 @@ PRectangle ListBoxX::GetDesiredRect() {
gtk_widget_path_iter_set_object_name(widget_path, -1, "border");
gtk_style_context_set_path(styleContextFrameBorder, widget_path);
gtk_widget_path_free(widget_path);
- gtk_style_context_get_border(styleContextFrameBorder, GTK_STATE_FLAG_NORMAL, &border_border);
+ gtk_style_context_get_border(styleContextFrameBorder, stateFlagsFrame, &border_border);
g_object_unref(styleContextFrameBorder);
# else // < 3.20
if (gtk_check_version(3, 20, 0) == NULL) {