Update tiled_wm test for tiled-console scenario

- always assign apps/overlay to targets (visible=true/false) to
  prevent 0x0 geometry, which is interpreted as close
- add QMenu as exampel to panel button
- use usb-tablet on Qemu
This commit is contained in:
Christian Helmuth 2024-03-21 09:15:59 +01:00
parent c27d04e338
commit e0fe046ad3
4 changed files with 23 additions and 15 deletions

View File

@ -221,6 +221,8 @@ install_config {
build_boot_image [qt5_boot_modules]
append qemu_args " -device nec-usb-xhci,id=xhci -device usb-tablet"
run_genode_until forever
# vi: set ft=tcl :

View File

@ -140,6 +140,11 @@ void Test::Manager::report_layout_rules()
xml.node("column", [&] () {
xml.attribute("name", "screen");
xml.attribute("layer", "1");
xml.node("row", [&] () {
xml.attribute("name", "panel");
xml.attribute("layer", "2");
xml.attribute("height", "24");
});
xml.node("row", [&] () {
xml.attribute("name", "content");
xml.attribute("layer", "4");
@ -152,23 +157,18 @@ void Test::Manager::report_layout_rules()
xml.attribute("weight", "1");
});
});
xml.node("row", [&] () {
xml.attribute("name", "panel");
xml.attribute("layer", "2");
xml.attribute("height", "24");
});
});
});
xml.node("assign", [&] () {
xml.attribute("label_prefix", "test-tiled_wm-panel");
xml.attribute("target", "panel");
});
if (overlay_visible) {
xml.node("assign", [&] () {
xml.attribute("label_prefix", "test-tiled_wm-overlay");
xml.attribute("target", "overlay");
});
}
xml.node("assign", [&] () {
xml.attribute("label_prefix", "test-tiled_wm-overlay");
xml.attribute("target", "overlay");
if (!overlay_visible)
xml.attribute("visible", false);
});
/* debug */
if (false) {
@ -181,13 +181,12 @@ void Test::Manager::report_layout_rules()
}
for (App &app : apps) {
if (!app.visible) continue;
xml.node("assign", [&] () {
xml.attribute("label_prefix", app.label);
xml.attribute("target", "content");
if (!app.visible)
xml.attribute("visible", "false");
});
break;
}
});
}

View File

@ -19,7 +19,7 @@
#include "panel.h"
void Panel_button::_clicked() { Q_EMIT clicked(text()); }
void Panel_button::_clicked() { Q_EMIT clicked(text()); if (text() == "Panel") showMenu(); }
void Panel_button::_toggled(bool checked) { Q_EMIT toggled(checked, text()); }
@ -34,6 +34,11 @@ Panel_button::Panel_button(QString label)
_layout->addWidget(_icon, 0, Qt::AlignCenter);
if (label == "Panel") {
_menu->addAction("Action");
setMenu(_menu);
}
connect(this, SIGNAL(clicked()), SLOT(_clicked()));
connect(this, SIGNAL(toggled(bool)), SLOT(_toggled(bool)));
}

View File

@ -19,6 +19,7 @@
#include <QPushButton>
#include <QWidget>
#include <QButtonGroup>
#include <QMenu>
/* Qoost includes */
#include <qoost/compound_widget.h>
@ -40,6 +41,7 @@ class Panel_button : public Compound_widget<QPushButton, QHBoxLayout>
private:
QMember<Icon> _icon;
QMember<QMenu> _menu;
private Q_SLOTS: