diff options
author | Ondrej Čerman | 2020-02-18 21:09:10 +0100 |
---|---|---|
committer | Ondrej Čerman | 2020-02-18 21:09:10 +0100 |
commit | e3d4b60da670cff66c53f0e66bb1b1ef907a66d4 (patch) | |
tree | b03cf20e5ff42f947715fe5aea7d91c2081fb873 /src | |
parent | d3464ba638a1f34ce95aea491617251f150afae3 (diff) |
Auto resize FIX: take vertical separator into account
Diffstat (limited to 'src')
-rw-r--r-- | src/gui.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -185,7 +185,7 @@ static gboolean mid_search_eq_func(GtkTreeModel *model, gint column, const gchar } static void resize_to_treeview(GtkWindow* window, GtkTreeView* treeview) { - gint uiHeight, cellHeight, rows; + gint uiHeight, cellHeight, vSeparator, rows; GdkRectangle r; GtkTreeViewColumn *col = gtk_tree_view_get_column(treeview, 0); @@ -193,12 +193,13 @@ static void resize_to_treeview(GtkWindow* window, GtkTreeView* treeview) { return; gtk_tree_view_column_cell_get_size(col, NULL, NULL, NULL, NULL, &cellHeight); + gtk_widget_style_get(GTK_WIDGET(treeview), "vertical-separator", &vSeparator, NULL); rows = gtk_tree_model_iter_n_children(gtk_tree_view_get_model(treeview), NULL); gtk_tree_view_get_visible_rect(treeview, &r); uiHeight = defaultHeight - r.height; - gtk_window_resize(window, 500, uiHeight + cellHeight * rows); + gtk_window_resize(window, 500, uiHeight + (vSeparator + cellHeight) * rows); } int start_gui (SensorSource *ss) { |