Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vkconfig3: Don't allow implicit layer forced on #2111

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vkconfig_core/type_layer_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
const char* GetToken(LayerControl control) {
static const char* TOKENS[] = {
"Auto", // LAYER_CONTROL_AUTO
"On", // LAYER_CONTROL_ON
"Off", // LAYER_CONTROL_OFF
"On", // LAYER_CONTROL_ON
"application_enabled_layers", // LAYER_CONTROL_APPLICATIONS
"unordered_layer_location" // LAYER_CONTROL_UNORDERED
};
Expand Down
9 changes: 6 additions & 3 deletions vkconfig_core/type_layer_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@

enum LayerControl {
LAYER_CONTROL_AUTO = 0,
LAYER_CONTROL_ON,
LAYER_CONTROL_OFF,
LAYER_CONTROL_ON,
LAYER_CONTROL_APPLICATIONS_API,
LAYER_CONTROL_APPLICATIONS_ENV,

LAYER_CONTROL_FIRST = LAYER_CONTROL_AUTO,
LAYER_CONTROL_LAST = LAYER_CONTROL_APPLICATIONS_ENV,

LAYER_CONTROL_UI_FIRST = LAYER_CONTROL_AUTO,
LAYER_CONTROL_UI_LAST = LAYER_CONTROL_OFF
LAYER_CONTROL_EXPLICIT_FIRST = LAYER_CONTROL_AUTO,
LAYER_CONTROL_EXPLICIT_LAST = LAYER_CONTROL_ON,

LAYER_CONTROL_IMPLICIT_FIRST = LAYER_CONTROL_AUTO,
LAYER_CONTROL_IMPLICIT_LAST = LAYER_CONTROL_OFF
};

enum { LAYER_CONTROL_COUNT = LAYER_CONTROL_LAST - LAYER_CONTROL_FIRST + 1 };
Expand Down
12 changes: 10 additions & 2 deletions vkconfig_gui/widget_tab_configurations_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,16 @@ ConfigurationLayerWidget::ConfigurationLayerWidget(TabConfigurations *tab, const
// this->layer_version->installEventFilter(this);

this->layer_state = new QComboBox(this);
for (int i = LAYER_CONTROL_UI_FIRST; i <= LAYER_CONTROL_UI_LAST; ++i) {
this->layer_state->addItem(GetToken(static_cast<LayerControl>(i)));
if (layer != nullptr) {
if (layer->type == LAYER_TYPE_EXPLICIT) {
for (int i = LAYER_CONTROL_EXPLICIT_FIRST; i <= LAYER_CONTROL_EXPLICIT_LAST; ++i) {
this->layer_state->addItem(GetToken(static_cast<LayerControl>(i)));
}
} else {
for (int i = LAYER_CONTROL_IMPLICIT_FIRST; i <= LAYER_CONTROL_IMPLICIT_LAST; ++i) {
this->layer_state->addItem(GetToken(static_cast<LayerControl>(i)));
}
}
}
this->layer_state->setEnabled(!layer_versions.empty());
this->layer_state->setCurrentIndex(parameter.control);
Expand Down