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 | f6f890b4f6735d346417067987e826734a245e11 (patch) | |
| tree | 7de0d1a8ed1994c65526ee4cb6dfb086ca4ee94d | |
| parent | fc18df4e0657d994445f21f2dca0168c5c4b4b52 (diff) | |
| download | scintilla-mirror-f6f890b4f6735d346417067987e826734a245e11.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() { |
