Skip to content

Commit

Permalink
vkconfig3: Improve layer control UI combobox on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Nov 28, 2024
1 parent 803bfbb commit 172f4d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion vkconfig_gui/tab_configurations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ void TabConfigurations::UpdateUI_Layers(UpdateUIMode mode) {
}
}

ListItem *item = new ListItem(parameter.key.c_str());
QListWidgetItem *item = new ListItem(parameter.key.c_str());
item->setFlags(item->flags() | Qt::ItemIsSelectable);
item->setSizeHint(QSize(0, ITEM_HEIGHT));
if (has_multiple_parameter) {
item->setIcon(QIcon(":/resourcefiles/drag.png"));
}
Expand Down
2 changes: 1 addition & 1 deletion vkconfig_gui/tab_layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void TabLayers::UpdateUI_LayersPaths(UpdateUIMode ui_update_mode) {
for (std::size_t i = 0, n = paths_group.size(); i < n; ++i) {
QTreeWidgetItem *item_state = new QTreeWidgetItem;
item_state->setFlags(item_state->flags() | Qt::ItemIsSelectable);
item_state->setSizeHint(0, QSize(0, 32));
item_state->setSizeHint(0, QSize(0, ITEM_HEIGHT));
LayersPathWidget *layer_path_widget = new LayersPathWidget(paths_group[i], group_path);
this->connect(layer_path_widget, SIGNAL(itemChanged()), this, SLOT(on_check_box_paths_changed()));

Expand Down
7 changes: 2 additions & 5 deletions vkconfig_gui/widget_tab_configurations_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ ConfigurationLayerWidget::ConfigurationLayerWidget(TabConfigurations *tab, const
} else if (!parameter.manifest.Empty()) {
this->setToolTip(parameter.manifest.AbsolutePath().c_str());
}

this->layer_state->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
this->layer_state->setSizeAdjustPolicy(QComboBox::AdjustToContents);
this->layer_state->adjustSize();
}

bool ConfigurationLayerWidget::eventFilter(QObject *target, QEvent *event) {
Expand All @@ -123,8 +119,9 @@ void ConfigurationLayerWidget::resizeEvent(QResizeEvent *event) {
this->layer_state->adjustSize();

const int width_state = this->layer_state->width();
const int height_state = this->layer_state->height();

const QRect state_button_rect = QRect(size.width() - width_state, 0, width_state, size.height());
const QRect state_button_rect = QRect(size.width() - width_state, 0, width_state, height_state);
this->layer_state->setGeometry(state_button_rect);
}
}
Expand Down

0 comments on commit 172f4d7

Please sign in to comment.