mirror of
https://github.com/polybar/polybar.git
synced 2026-03-29 19:46:49 +00:00
tray: remove tray-position = adaptive (#2726)
The tray is automatically started if there is a tray module. In addition, `tray-position` and the tray module conflict. Ref #2689
This commit is contained in:
@ -388,13 +388,14 @@ void bar::parse(string&& data, bool force) {
|
||||
|
||||
auto rect = m_opts.inner_area();
|
||||
|
||||
if (m_tray && !m_tray->settings().detached && m_tray->settings().configured_slots && !m_tray->settings().adaptive) {
|
||||
auto trayalign = m_tray->settings().align;
|
||||
if (m_tray && !m_tray->settings().detached && m_tray->settings().configured_slots &&
|
||||
m_tray->settings().tray_position != tray_postition::MODULE) {
|
||||
auto tray_pos = m_tray->settings().tray_position;
|
||||
auto traywidth = m_tray->settings().configured_w;
|
||||
if (trayalign == alignment::LEFT) {
|
||||
if (tray_pos == tray_postition::LEFT) {
|
||||
rect.x += traywidth;
|
||||
rect.width -= traywidth;
|
||||
} else if (trayalign == alignment::RIGHT) {
|
||||
} else if (tray_pos == tray_postition::RIGHT) {
|
||||
rect.width -= traywidth;
|
||||
}
|
||||
}
|
||||
@ -872,7 +873,7 @@ void bar::handle(const evt::configure_notify&) {
|
||||
m_sig.emit(signals::ui::update_geometry{});
|
||||
}
|
||||
|
||||
void bar::start() {
|
||||
void bar::start(const string& tray_module_name) {
|
||||
m_log.trace("bar: Create renderer");
|
||||
m_renderer = renderer::make(m_opts, *m_action_ctxt);
|
||||
m_opts.window = m_renderer->window();
|
||||
@ -900,7 +901,7 @@ void bar::start() {
|
||||
m_renderer->end();
|
||||
|
||||
m_log.trace("bar: Setup tray manager");
|
||||
m_tray->setup();
|
||||
m_tray->setup(tray_module_name);
|
||||
|
||||
broadcast_visibility();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user