Warning: session_start(): open(/var/lib/php/sessions/sess_ho2a3bnhdlsn9i3ffj4m3j6n6i, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
sclass TaskBar extends DynSCP {
transient SimpleLiveValue lvInvisible = stringLiveValue();
transient bool vertical;
bool shouldBeVertical() {
ret rectHigherThanWide(dm_getBounds());
}
JComponent visualize2() {
L buttons = makeButtons();
JLabel lblInvisible = onLeftClick(jLiveValueLabel(lvInvisible), r dm_showInvisibleModulesList);
ret (vertical = shouldBeVertical())
? jscroll_dynamicvstack(dynamicVStack2(listPlus(
buttons, withMargin(6, lblInvisible))))
: centerAndEast(hgrid(buttons), withLeftAndRightMargin(6, 3, lblInvisible));
}
void enhanceFrame(Container f) {
super.enhanceFrame(f);
addTitlePopupMenuItem(f, "Place on bottom", rThread placeOnBottom);
onResize(f, r {
if (vertical != shouldBeVertical()) {
vertical = shouldBeVertical();
revisualize();
}
});
}
void placeOnBottom {
Container frame = dm_frame();
Rectangle desktop = getBounds(dm_desktopPane());
if (frame != null && desktop != null) {
packInternalFrameVertically_noFix((JInternalFrame) frame);
Rectangle me = getBounds(frame);
dm_setBounds(dm_current(), 0, desktop.height-me.height,
desktop.width, me.height);
}
}
void update { revisualize2(); }
L makeButtons() {
new L out;
new L invisible;
L modules = dm_listModules();
// TODO: get module names all at once
for (fO m : modules)
if (m != this)
if (dm_isVisible(m)) {
final WeakReference ref = new(m); // allow GC for modules
out.add(jbutton(dm_moduleName(m), r { dm_showModule(ref!) }));
} else invisible.add(m);
lvInvisible.set(empty(invisible) ? "" : "+ " + l(invisible) + " invisible");
ret out;
}
}