Commit aa026e01 authored by Alexander Schwinn's avatar Alexander Schwinn

Fix of messed up row-height with disabled "automatically expand columns

as needed" in detailed view. (Part II)
(Bug #14548)
parent 91eeeeb8
......@@ -901,12 +901,16 @@ static void
thunar_details_view_zoom_level_changed (ThunarDetailsView *details_view)
{
ThunarColumn column;
gboolean fixed_columns_used = FALSE;
_thunar_return_if_fail (THUNAR_IS_DETAILS_VIEW (details_view));
/* Disable fixed height optimization during resize, since it can mess up the row height */
if (details_view->fixed_columns)
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (gtk_bin_get_child (GTK_BIN (details_view))), FALSE);
if (details_view->fixed_columns == TRUE)
fixed_columns_used = TRUE;
/* Disable fixed column mode during resize, since it can generate graphical glitches */
if (fixed_columns_used)
thunar_details_view_set_fixed_columns (details_view, FALSE);
/* determine the list of tree view columns */
for (column = 0; column < THUNAR_N_VISIBLE_COLUMNS; ++column)
......@@ -915,8 +919,13 @@ thunar_details_view_zoom_level_changed (ThunarDetailsView *details_view)
gtk_tree_view_column_queue_resize (details_view->columns[column]);
}
if (details_view->fixed_columns)
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (gtk_bin_get_child (GTK_BIN (details_view))), TRUE);
if (fixed_columns_used)
{
thunar_details_view_set_fixed_columns (details_view, TRUE);
/* For unknown reason a reload is required to display the correct row-height (otherwise some rows will keep the old height )*/
thunar_standard_view_reload (THUNAR_VIEW (details_view), TRUE);
}
}
......@@ -978,6 +987,10 @@ thunar_details_view_set_fixed_columns (ThunarDetailsView *details_view,
/* apply the new value */
details_view->fixed_columns = fixed_columns;
/* disable in reverse order, otherwise graphical glitches can appear*/
if (!fixed_columns)
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (gtk_bin_get_child (GTK_BIN (details_view))), FALSE);
/* apply the new setting to all columns */
for (column = 0; column < THUNAR_N_VISIBLE_COLUMNS; ++column)
{
......@@ -1001,9 +1014,9 @@ thunar_details_view_set_fixed_columns (ThunarDetailsView *details_view,
}
/* for fixed columns mode, we can enable the fixed height
* mode to improve the performance of the GtkTreeVeiw.
*/
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (gtk_bin_get_child (GTK_BIN (details_view))), fixed_columns);
* mode to improve the performance of the GtkTreeVeiw. */
if (fixed_columns)
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (gtk_bin_get_child (GTK_BIN (details_view))), TRUE);
/* notify listeners */
g_object_notify (G_OBJECT (details_view), "fixed-columns");
......
......@@ -139,8 +139,6 @@ static ThunarZoomLevel thunar_standard_view_get_zoom_level (Thu
static void thunar_standard_view_set_zoom_level (ThunarView *view,
ThunarZoomLevel zoom_level);
static void thunar_standard_view_reset_zoom_level (ThunarView *view);
static void thunar_standard_view_reload (ThunarView *view,
gboolean reload_info);
static gboolean thunar_standard_view_get_visible_range (ThunarView *view,
ThunarFile **start_file,
ThunarFile **end_file);
......@@ -1726,7 +1724,7 @@ thunar_standard_view_reset_zoom_level (ThunarView *view)
static void
void
thunar_standard_view_reload (ThunarView *view,
gboolean reload_info)
{
......
......@@ -148,6 +148,8 @@ void thunar_standard_view_context_menu (ThunarStandardView *standard_view
void thunar_standard_view_queue_popup (ThunarStandardView *standard_view,
GdkEventButton *event);
void thunar_standard_view_reload (ThunarView *view,
gboolean reload_info);
void thunar_standard_view_selection_changed (ThunarStandardView *standard_view);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment