Bar::setLayout: take layout name instead of number

This commit is contained in:
Raphael Robatsch 2021-10-29 23:25:07 +02:00
parent 6da4df255c
commit e2c4eb6185
3 changed files with 3 additions and 3 deletions

View File

@ -115,7 +115,7 @@ void Bar::setTag(int tag, znet_tapesoftware_dwl_wm_monitor_v1_tag_state state, i
t.focusedClient = focusedClient;
}
void Bar::setSelected(bool selected) { _selected = selected; }
void Bar::setLayout(int layout) { _layoutCmp.setText(layoutNames[layout]); }
void Bar::setLayout(const std::string& layout) { _layoutCmp.setText(layout); }
void Bar::setTitle(const std::string& title) { _titleCmp.setText(title); }
void Bar::setStatus(const std::string& status) { _statusCmp.setText(status); }

View File

@ -67,7 +67,7 @@ public:
void hide();
void setTag(int tag, znet_tapesoftware_dwl_wm_monitor_v1_tag_state state, int numClients, int focusedClient);
void setSelected(bool selected);
void setLayout(int layout);
void setLayout(const std::string& layout);
void setTitle(const std::string& title);
void setStatus(const std::string& status);
void invalidate();

View File

@ -231,7 +231,7 @@ static const struct znet_tapesoftware_dwl_wm_monitor_v1_listener dwlWmMonitorLis
},
.layout = [](void* mv, znet_tapesoftware_dwl_wm_monitor_v1*, uint32_t layout) {
auto mon = static_cast<Monitor*>(mv);
mon->bar->setLayout(layout);
mon->bar->setLayout(layoutNames[layout]);
},
.title = [](void* mv, znet_tapesoftware_dwl_wm_monitor_v1*, const char* title) {
auto mon = static_cast<Monitor*>(mv);