diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2014-09-24 18:25:51 +0200 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2014-09-24 18:25:51 +0200 |
commit | b706fd7443e5c2364d48f822b4e956bc589b1116 (patch) | |
tree | 7fe3aaf6a2952ee9496183691c5d26dba1bbb796 | |
parent | 2e246a4a328db1d2f0969733226fd35395ff63f8 (diff) | |
download | scintilla-mirror-b706fd7443e5c2364d48f822b4e956bc589b1116.tar.gz |
GTK: Fix auto-completion popup row height computation on GTK 3.14
GTK 3.14 changed how the cell padding is calculated, and I can't seem
to understand the new logic yet. So, use the correct API for computing
the row size, which unfortunately doesn't work for us on GTK2, but
otherwise is a better way to go anyway.
Tested with GTK 3.2, 3.8, 3.10, 3.12 and 3.14.
-rw-r--r-- | gtk/PlatGTK.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 28ad37140..c1d7ac7ae 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1658,6 +1658,14 @@ int ListBoxX::GetVisibleRows() const { int ListBoxX::GetRowHeight() { +#if GTK_CHECK_VERSION(3,0,0) + // This version sometimes reports erroneous results on GTK2, but the GTK2 + // version is inaccurate for GTK 3.14. + GdkRectangle rect; + GtkTreePath *path = gtk_tree_path_new_first(); + gtk_tree_view_get_background_area(GTK_TREE_VIEW(list), path, NULL, &rect); + return rect.height; +#else int row_height=0; int vertical_separator=0; int expander_size=0; @@ -1669,6 +1677,7 @@ int ListBoxX::GetRowHeight() row_height += vertical_separator; row_height = Platform::Maximum(row_height, expander_size); return row_height; +#endif } PRectangle ListBoxX::GetDesiredRect() { |