PixelPaint: Make scopes hideable

Vectorscope and Histogram are now hidden by default. New menu "Scopes"
allows for them to be toggled on/off.
This commit is contained in:
Timothy Slater 2022-10-26 07:53:39 -05:00 committed by Andreas Kling
parent 90d967baf1
commit e73aeb4cea
Notes: sideshowbarker 2024-07-17 05:03:57 +09:00
2 changed files with 13 additions and 0 deletions

View File

@ -509,6 +509,17 @@ void MainWidget::initialize_menubar(GUI::Window& window)
m_show_active_layer_boundary_action->set_checked(Config::read_bool("PixelPaint"sv, "ImageEditor"sv, "ShowActiveLayerBoundary"sv, true));
m_view_menu->add_action(*m_show_active_layer_boundary_action);
m_view_menu->add_separator();
auto& scopes_menu = m_view_menu->add_submenu("&Scopes");
scopes_menu.add_action(GUI::Action::create_checkable("&Histogram", [&](auto& action) {
m_histogram_widget->parent_widget()->set_visible(action.is_checked());
}));
scopes_menu.add_action(GUI::Action::create_checkable("&Vectorscope", [&](auto& action) {
m_vectorscope_widget->parent_widget()->set_visible(action.is_checked());
}));
m_tool_menu = window.add_menu("&Tool");
m_toolbox->for_each_tool([&](auto& tool) {
if (tool.action())

View File

@ -67,6 +67,7 @@
@GUI::GroupBox {
title: "Histogram"
preferred_height: "shrink"
visible: false
layout: @GUI::VerticalBoxLayout {
margins: [6]
}
@ -80,6 +81,7 @@
@GUI::GroupBox {
title: "Vectorscope"
min_height: 80
visible: false
layout: @GUI::VerticalBoxLayout {
margins: [6]
}