From 65b3261320ec640ee32788d137b04304508f6023 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 28 Apr 2020 00:10:04 +0200 Subject: [PATCH] Hide connections menu when only one connection is configured * Make UI look cleaner for the common case of only one configuration * Save some width to help with https://github.com/Martchus/syncthingtray/issues/65 a little bit --- plasmoid/package/contents/ui/FullRepresentation.qml | 1 + tray/gui/traywidget.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/plasmoid/package/contents/ui/FullRepresentation.qml b/plasmoid/package/contents/ui/FullRepresentation.qml index 791186b..e649cb7 100644 --- a/plasmoid/package/contents/ui/FullRepresentation.qml +++ b/plasmoid/package/contents/ui/FullRepresentation.qml @@ -394,6 +394,7 @@ ColumnLayout { paddingEnabled: true enforceMenuArrow: true onClicked: connectionConfigsMenu.toggle(x, y + height) + visible: plasmoid.nativeInterface.connectionConfigNames.length > 1 Shortcut { sequence: "Ctrl+Shift+C" onActivated: connectionsButton.clicked() diff --git a/tray/gui/traywidget.cpp b/tray/gui/traywidget.cpp index 55de265..d576b3e 100644 --- a/tray/gui/traywidget.cpp +++ b/tray/gui/traywidget.cpp @@ -433,6 +433,7 @@ void TrayWidget::applySettings(const QString &connectionConfig) m_connectionsMenu->actions().at(0)->setChecked(true); } m_ui->connectionsPushButton->setText(m_selectedConnection->label); + m_ui->connectionsPushButton->setHidden(secondaryConnectionSettings.empty()); const bool reconnectRequired = m_connection.applySettings(*m_selectedConnection); // apply notification settings