Allow opening Syncthing directly when clicking on tray icon
This might be useful if minimalism is desired or to avoid positioning issues on Wayland.
This commit is contained in:
parent
9360bf8bc8
commit
04a8905a83
|
@ -544,6 +544,9 @@ the appearance settings. That doesn't fix the positioning issue but then it
|
||||||
looks just like a normal application so not being positioned in the tray area is
|
looks just like a normal application so not being positioned in the tray area is
|
||||||
less problematic.
|
less problematic.
|
||||||
|
|
||||||
|
You can also select the window type "None". This disables Syncthing Tray's own UI
|
||||||
|
completely and instead opens Syncthing directly when the tray icon is clicked.
|
||||||
|
|
||||||
### Workaround broken High-DPI scaling of Plasmoid under X11
|
### Workaround broken High-DPI scaling of Plasmoid under X11
|
||||||
Setting the environment variable `PLASMA_USE_QT_SCALING=1` should fix the
|
Setting the environment variable `PLASMA_USE_QT_SCALING=1` should fix the
|
||||||
[issue](https://bugs.kde.org/show_bug.cgi?id=356446) on recent Plasma versions but
|
[issue](https://bugs.kde.org/show_bug.cgi?id=356446) on recent Plasma versions but
|
||||||
|
|
|
@ -388,6 +388,11 @@
|
||||||
<string>Window without titlebar</string>
|
<string>Window without titlebar</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>None - open Syncthing directly</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
|
|
|
@ -64,6 +64,10 @@ static void moveInside(QPoint &point, const QSize &innerRect, const QRect &outer
|
||||||
|
|
||||||
void TrayMenu::showUsingPositioningSettings()
|
void TrayMenu::showUsingPositioningSettings()
|
||||||
{
|
{
|
||||||
|
if (m_windowType == WindowType::None) {
|
||||||
|
widget().showWebUI();
|
||||||
|
return;
|
||||||
|
}
|
||||||
resize(sizeHint());
|
resize(sizeHint());
|
||||||
auto pos = Settings::values().appearance.positioning.positionToUse();
|
auto pos = Settings::values().appearance.positioning.positionToUse();
|
||||||
if (pos.has_value()) {
|
if (pos.has_value()) {
|
||||||
|
@ -77,7 +81,7 @@ void TrayMenu::showUsingPositioningSettings()
|
||||||
|
|
||||||
void TrayMenu::setWindowType(int windowType)
|
void TrayMenu::setWindowType(int windowType)
|
||||||
{
|
{
|
||||||
if (windowType >= 0 && windowType <= 2) {
|
if (windowType >= 0 && windowType <= 3) {
|
||||||
setWindowType(static_cast<WindowType>(windowType));
|
setWindowType(static_cast<WindowType>(windowType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,6 +102,8 @@ void TrayMenu::setWindowType(WindowType windowType)
|
||||||
case WindowType::CustomWindow:
|
case WindowType::CustomWindow:
|
||||||
flags = Qt::Dialog | Qt::CustomizeWindowHint;
|
flags = Qt::Dialog | Qt::CustomizeWindowHint;
|
||||||
break;
|
break;
|
||||||
|
case WindowType::None:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
setWindowFlags(flags);
|
setWindowFlags(flags);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ public:
|
||||||
Popup,
|
Popup,
|
||||||
NormalWindow,
|
NormalWindow,
|
||||||
CustomWindow,
|
CustomWindow,
|
||||||
|
None,
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit TrayMenu(TrayIcon *trayIcon = nullptr, QWidget *parent = nullptr);
|
explicit TrayMenu(TrayIcon *trayIcon = nullptr, QWidget *parent = nullptr);
|
||||||
|
|
Loading…
Reference in New Issue