Skip to content

Commit

Permalink
ColorListWidget: Fix table column resize mode (GH-2237)
Browse files Browse the repository at this point in the history
The individual setting 'QHeaderView::Stretch' of the 'Name' column's
resize mode was erroneously overwritten by the setting which was
intended for the 'Spot color' column.
Simply use the default  'QHeaderView::Interactive', and initialize
explicitly when there is no data to derive initial widths from.

Co-authored-by: Kai Pastor <[email protected]>
  • Loading branch information
dl3sdo and dg0yt authored Jun 2, 2024
1 parent d663693 commit 3ee8653
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/gui/widgets/color_list_widget.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2012, 2013 Thomas Schöps
* Copyright 2012-2017 Kai Pastor
* Copyright 2012-2024 Kai Pastor
*
* This file is part of OpenOrienteering.
*
Expand Down Expand Up @@ -160,11 +160,16 @@ ColorListWidget::ColorListWidget(Map* map, MainWindow* window, QWidget* parent)
header_view->resizeSections(QHeaderView::ResizeToContents);
header_view->setSectionResizeMode(0, QHeaderView::Fixed); // Color
header_view->resizeSection(0, 32);
header_view->setSectionResizeMode(1, QHeaderView::Stretch); // Name
header_view->setSectionResizeMode(1, QHeaderView::Interactive); // Spot colors
header_view->setSectionResizeMode(5, QHeaderView::Fixed); // Knockout
header_view->resizeSection(5, 32);
header_view->setSectionsClickable(false);
if (map->getNumColors() == 0)
{
header_view->resizeSection(1, 160); // Name
header_view->resizeSection(2, 128); // Spot colors
header_view->resizeSection(3, 96); // CMYK
header_view->resizeSection(4, 64); // RGB
}

currentCellChange(color_table->currentRow(), 0, 0, 0); // enable / disable move color buttons

Expand Down

0 comments on commit 3ee8653

Please sign in to comment.