mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 11:12:49 +00:00
BluetoothDevices: Honor Location
This commit is contained in:
parent
f7ff25f605
commit
c12bef29d2
1 changed files with 31 additions and 2 deletions
|
@ -299,8 +299,37 @@ namespace BluetoothDevices
|
||||||
WidgetBody(*mainWidget);
|
WidgetBody(*mainWidget);
|
||||||
|
|
||||||
window.SetExclusive(false);
|
window.SetExclusive(false);
|
||||||
window.SetMargin(Anchor::Top, 8);
|
Anchor anchor;
|
||||||
window.SetAnchor(Anchor::Right | Anchor::Top);
|
Anchor marginAnchor;
|
||||||
|
switch (Config::Get().location)
|
||||||
|
{
|
||||||
|
case 'T':
|
||||||
|
anchor = Anchor::Right | Anchor::Top;
|
||||||
|
marginAnchor = Anchor::Top;
|
||||||
|
break;
|
||||||
|
case 'B':
|
||||||
|
anchor = Anchor::Bottom | Anchor::Right;
|
||||||
|
marginAnchor = Anchor::Bottom;
|
||||||
|
break;
|
||||||
|
case 'L':
|
||||||
|
anchor = Anchor::Left | Anchor::Bottom;
|
||||||
|
marginAnchor = Anchor::Left;
|
||||||
|
// TODO: Config
|
||||||
|
window.SetMargin(Anchor::Bottom, 150);
|
||||||
|
break;
|
||||||
|
case 'R':
|
||||||
|
anchor = Anchor::Right | Anchor::Bottom;
|
||||||
|
marginAnchor = Anchor::Right;
|
||||||
|
// TODO: Config
|
||||||
|
window.SetMargin(Anchor::Bottom, 150);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG("Invalid location char \"" << Config::Get().location << "\"!");
|
||||||
|
anchor = Anchor::Right | Anchor::Top;
|
||||||
|
marginAnchor = Anchor::Top;
|
||||||
|
}
|
||||||
|
window.SetMargin(marginAnchor, 8);
|
||||||
|
window.SetAnchor(anchor);
|
||||||
window.SetMainWidget(std::move(mainWidget));
|
window.SetMainWidget(std::move(mainWidget));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue