sculpt: use icons for fb swap and merge/unmerge

Issue #5286
This commit is contained in:
Norman Feske 2024-10-28 17:23:54 +01:00 committed by Christian Helmuth
parent c9015d6076
commit 1660dc0635
9 changed files with 20 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -117,23 +117,27 @@ struct Sculpt::Fb_widget : Widget<Vbox>
s.sub_scope<Float>([&] (Scope<Vbox, Float> &s) {
s.sub_scope<Hbox>(id, [&] (Scope<Vbox, Float, Hbox> &s) {
s.sub_scope<Button>(Id { "equal" }, [&] (Scope<Vbox, Float, Hbox, Button> &s) {
if (count <= num_merged)
s.attribute("selected", "yes");
if (count == num_merged || count == num_merged + 1) {
s.sub_scope<Float>(Id { "equal" }, [&] (Scope<Vbox, Float, Hbox, Float> &s) {
s.sub_scope<Button>([&] (Scope<Vbox, Float, Hbox, Float, Button> &s) {
s.attribute("style", "vconn");
if (count <= num_merged)
s.attribute("selected", "yes");
if (count == num_merged || count == num_merged + 1) {
if (s.hovered() && !s.dragged())
s.attribute("hovered", "yes");
}
s.sub_node("hbox", [&] { });
});
});
s.sub_scope<Float>(Id { "swap" }, [&] (Scope<Vbox, Float, Hbox, Float> &s) {
s.sub_scope<Button>([&] (Scope<Vbox, Float, Hbox, Float, Button> &s) {
s.attribute("style", "vswap");
if (s.hovered() && !s.dragged())
s.attribute("hovered", "yes");
} else {
s.attribute("style", "unimportant");
}
s.sub_scope<Label>("=");
});
s.sub_scope<Button>(Id { "swap" }, [&] (Scope<Vbox, Float, Hbox, Button> &s) {
s.sub_scope<Label>("Swap");
if (s.hovered() && !s.dragged())
s.attribute("hovered", "yes");
if (s.hovered() && s.dragged())
s.attribute("selected", "yes");
if (s.hovered() && s.dragged())
s.attribute("selected", "yes");
s.sub_node("hbox", [&] { });
});
});
});
});
@ -178,7 +182,7 @@ struct Sculpt::Fb_widget : Widget<Vbox>
/* operation buttons */
{
Id const conn = at.matching_id<Vbox, Float, Hbox>();
Id const op = at.matching_id<Vbox, Float, Hbox, Button>();
Id const op = at.matching_id<Vbox, Float, Hbox, Float>();
if (op.value == "equal") action.toggle_fb_merge_discrete(conn.value);
if (op.value == "swap") action.swap_fb_connector(conn.value);