Separate general GUI managing code and global configuration from toolbar UI code

This commit is contained in:
Yousef Khadadeh 2026-03-31 13:17:58 +03:00
parent 2abe7271a8
commit ea35397326
53 changed files with 859 additions and 788 deletions

View file

@ -35,21 +35,22 @@ void DrawingProgramSelection::selection_gui() {
using namespace GUIStuff;
using namespace ElementHelpers;
auto& t = drawP.world.main.toolbar;
t.gui.new_id("general selection gui", [&] {
text_label(t.gui, "Select from:");
radio_button_selector(t.gui, "layer selector", &drawP.controls.layerSelector, {
auto& gui = drawP.world.main.g.gui;
gui.new_id("general selection gui", [&] {
text_label(gui, "Select from:");
radio_button_selector(gui, "layer selector", &drawP.controls.layerSelector, {
{"Layer being edited", DrawingProgramLayerManager::LayerSelector::LAYER_BEING_EDITED},
{"All visible layers", DrawingProgramLayerManager::LayerSelector::ALL_VISIBLE_LAYERS}
});
if(is_something_selected()) {
left_to_right_line_layout(t.gui, [&]() {
//if(t.gui.color_button_big("Stroke Color Button", &strokeColorChangeData.newColor, &strokeColorChangeData.newColor == t.colorRight)) {
left_to_right_line_layout(gui, [&]() {
//if(gui.color_button_big("Stroke Color Button", &strokeColorChangeData.newColor, &strokeColorChangeData.newColor == t.colorRight)) {
// if(strokeColorChangeData.newColor.w() == 0.0f)
// strokeColorChangeData.newColor.w() = 1.0f;
// t.color_selector_right(&strokeColorChangeData.newColor == t.colorRight ? nullptr : &strokeColorChangeData.newColor);
//}
text_label(t.gui, "Stroke Color");
text_label(gui, "Stroke Color");
});
update_selection_stroke_color();
}