mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 13:26:27 +00:00
sculpt: restrict un-merging of fb connectors
In setups with 3 or more displays, allow the un-merging of connectors only for the last mirrored connector. Otherwise, the operation would implicitely change the order of connectors because the new discrete connector needs appear after all merged connectors. Issue #5286
This commit is contained in:
parent
2d3170124d
commit
324245d029
@ -117,12 +117,21 @@ 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<Float>(Id { "equal" }, [&] (Scope<Vbox, Float, Hbox, Float> &s) {
|
||||
|
||||
/*
|
||||
* Restrict merge/unmerge toggle to last merged and first
|
||||
* discrete connector.
|
||||
*/
|
||||
bool const toggle_allowed = (count == num_merged || count == num_merged + 1);
|
||||
Id const equal_id { toggle_allowed ? "equal" : "_equal" };
|
||||
|
||||
s.sub_scope<Float>(equal_id,
|
||||
[&] (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 (toggle_allowed) {
|
||||
if (s.hovered() && !s.dragged())
|
||||
s.attribute("hovered", "yes");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user