parent
a960f2ff30
commit
5e8a6f0bcb
13 changed files with 104 additions and 61 deletions
|
|
@ -57,6 +57,7 @@ It will begin with `[client]`
|
|||
| invertScrollDirection | `true` or `false` | Invert scroll on this client [default: false] |
|
||||
| languageSync | `true` or `false` | Sync to server language [default: true] |
|
||||
| remoteHost | `IP` or `hostname` | The remote host(s) to connect to. Use a comma seperated list when you want to try severial hosts |
|
||||
| yScrollScale | Double 0.1 - 10.0 | Mouse scrolling will be scaled by this amount on the client [default: 1.0] |
|
||||
| xdpRestoreToken | UUID | Restore token provided by XDG portals |
|
||||
|
||||
### Core
|
||||
|
|
|
|||
|
|
@ -204,8 +204,8 @@ QVariant Settings::defaultValue(const QString &key)
|
|||
if (key == Daemon::LogFile)
|
||||
return QStringLiteral("%1/%2-daemon.log").arg(Settings::settingsPath(), kAppId);
|
||||
|
||||
if (key == Client::ScrollSpeed)
|
||||
return 120;
|
||||
if (key == Client::YScrollScale)
|
||||
return 1.0;
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public:
|
|||
{
|
||||
inline static const auto InvertScrollDirection = QStringLiteral("client/invertScrollDirection");
|
||||
inline static const auto ScrollSpeed = QStringLiteral("client/yscroll");
|
||||
inline static const auto YScrollScale = QStringLiteral("client/yScrollScale");
|
||||
inline static const auto LanguageSync = QStringLiteral("client/languageSync");
|
||||
inline static const auto RemoteHost = QStringLiteral("client/remoteHost");
|
||||
inline static const auto XdpRestoreToken = QStringLiteral("client/xdpRestoreToken");
|
||||
|
|
@ -195,6 +196,7 @@ private:
|
|||
, Settings::Client::LanguageSync
|
||||
, Settings::Client::RemoteHost
|
||||
, Settings::Client::ScrollSpeed
|
||||
, Settings::Client::YScrollScale
|
||||
, Settings::Client::XdpRestoreToken
|
||||
, Settings::Core::CoreMode
|
||||
, Settings::Core::Interface
|
||||
|
|
|
|||
|
|
@ -7,13 +7,14 @@
|
|||
|
||||
#include "deskflow/PlatformScreen.h"
|
||||
#include "base/DirectionTypes.h"
|
||||
#include "common/Settings.h"
|
||||
#include "deskflow/App.h"
|
||||
|
||||
PlatformScreen::PlatformScreen(IEventQueue *events, bool invertScrolling)
|
||||
: IPlatformScreen(events),
|
||||
m_invertScrollDirection(invertScrolling)
|
||||
{
|
||||
// do nothing
|
||||
m_scrollScale = std::clamp(Settings::value(Settings::Client::YScrollScale).toDouble(), 0.1, 10.0);
|
||||
}
|
||||
|
||||
void PlatformScreen::updateKeyMap()
|
||||
|
|
@ -91,6 +92,7 @@ void PlatformScreen::clearStaleModifiers()
|
|||
|
||||
int32_t PlatformScreen::mapClientScrollDirection(int32_t x) const
|
||||
{
|
||||
x *= m_scrollScale;
|
||||
return (m_invertScrollDirection ? -x : x);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,4 +114,11 @@ private:
|
|||
* This member is used only on client side.
|
||||
*/
|
||||
bool m_invertScrollDirection = false;
|
||||
|
||||
/**
|
||||
* @brief m_scrollScale
|
||||
* This member is used to scale the scroll speed
|
||||
* It is only used on the client side
|
||||
*/
|
||||
double m_scrollScale = 1.0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ void SettingsDialog::accept()
|
|||
Settings::setValue(Settings::Gui::CloseToTray, ui->cbCloseToTray->isChecked());
|
||||
Settings::setValue(Settings::Gui::SymbolicTrayIcon, ui->rbIconMono->isChecked());
|
||||
Settings::setValue(Settings::Security::CheckPeers, ui->cbRequireClientCert->isChecked());
|
||||
Settings::setValue(Settings::Client::ScrollSpeed, ui->sbScrollSpeed->value());
|
||||
Settings::setValue(Settings::Client::YScrollScale, ui->sbYScrollScale->value());
|
||||
Settings::setValue(Settings::Core::Language, I18N::nativeTo639Name(ui->comboLanguage->currentText()));
|
||||
Settings::setValue(Settings::Log::GuiDebug, ui->cbGuiDebug->isChecked());
|
||||
Settings::setValue(Settings::Core::UseWlClipboard, ui->cbUseWlClipboard->isChecked());
|
||||
|
|
@ -215,7 +215,7 @@ void SettingsDialog::loadFromConfig()
|
|||
ui->cbCloseToTray->setChecked(Settings::value(Settings::Gui::CloseToTray).toBool());
|
||||
ui->cbElevateDaemon->setChecked(Settings::value(Settings::Daemon::Elevate).toBool());
|
||||
ui->cbAutoUpdate->setChecked(Settings::value(Settings::Gui::AutoUpdateCheck).toBool());
|
||||
ui->sbScrollSpeed->setValue(Settings::value(Settings::Client::ScrollSpeed).toInt());
|
||||
ui->sbYScrollScale->setValue(Settings::value(Settings::Client::YScrollScale).toDouble());
|
||||
ui->cbGuiDebug->setChecked(Settings::value(Settings::Log::GuiDebug).toBool());
|
||||
ui->cbUseWlClipboard->setChecked(Settings::value(Settings::Core::UseWlClipboard).toBool());
|
||||
ui->cbShowVersion->setChecked(Settings::value(Settings::Gui::ShowVersionInTitle).toBool());
|
||||
|
|
|
|||
|
|
@ -55,38 +55,69 @@
|
|||
<item>
|
||||
<widget class="QCheckBox" name="cbScrollDirection">
|
||||
<property name="text">
|
||||
<string>Invert scroll direction on this computer</string>
|
||||
<string>Invert vertical scroll direction on this computer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblScrollSpeed">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Scroll Speed</string>
|
||||
<string>Vertical Scroll Scale</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="sbScrollSpeed">
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="sbYScrollScale">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="wrapping">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="correctionMode">
|
||||
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
|||
|
|
@ -1112,14 +1112,6 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU
|
|||
<source>Use server's keyboard language on this computer</source>
|
||||
<translation type="unfinished">Utilice el idioma del teclado del servidor en esta computadora</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert scroll direction on this computer</source>
|
||||
<translation type="unfinished">Invertir la dirección de desplazamiento en esta computadora</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scroll Speed</source>
|
||||
<translation type="unfinished">Velocidad de desplazamiento</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>App</source>
|
||||
<translation type="unfinished">Aplicación</translation>
|
||||
|
|
@ -1324,6 +1316,14 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU
|
|||
<source>Include version in the window title</source>
|
||||
<translation type="unfinished">Incluir la versión en el título de la ventana</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert vertical scroll direction on this computer</source>
|
||||
<translation type="unfinished">Invertir la dirección del desplazamiento vertical en este ordenador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Vertical Scroll Scale</source>
|
||||
<translation type="unfinished">Escala de desplazamiento vertical</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>i18n</name>
|
||||
|
|
|
|||
|
|
@ -1112,14 +1112,6 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf
|
|||
<source>Use server's keyboard language on this computer</source>
|
||||
<translation>Usa la lingua della tastiera del server su questo computer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert scroll direction on this computer</source>
|
||||
<translation>Inverti la direzione di scorrimento su questo computer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scroll Speed</source>
|
||||
<translation>Velocità di scorrimento</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>App</source>
|
||||
<translation>App</translation>
|
||||
|
|
@ -1324,6 +1316,14 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf
|
|||
<source>Include version in the window title</source>
|
||||
<translation type="unfinished">Includi la versione nel titolo della finestra</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert vertical scroll direction on this computer</source>
|
||||
<translation type="unfinished">Inverti la direzione dello scorrimento verticale su questo computer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Vertical Scroll Scale</source>
|
||||
<translation type="unfinished">Scala di scorrimento verticale</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>i18n</name>
|
||||
|
|
|
|||
|
|
@ -1113,14 +1113,6 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Use server's keyboard language on this computer</source>
|
||||
<translation>サーバー側のキーボード言語をこのコンピューターで使用する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert scroll direction on this computer</source>
|
||||
<translation>このコンピューターのスクロール方向を反転する</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scroll Speed</source>
|
||||
<translation>スクロール速度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>App</source>
|
||||
<translation>アプリケーション</translation>
|
||||
|
|
@ -1325,6 +1317,14 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Include version in the window title</source>
|
||||
<translation type="unfinished">ウィンドウタイトルにバージョン情報を含める</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert vertical scroll direction on this computer</source>
|
||||
<translation type="unfinished">このコンピューターで垂直スクロールの方向を反転させる</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Vertical Scroll Scale</source>
|
||||
<translation type="unfinished">垂直スクロールスケール</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>i18n</name>
|
||||
|
|
|
|||
|
|
@ -1111,14 +1111,6 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Use server's keyboard language on this computer</source>
|
||||
<translation>이 컴퓨터에서 서버의 키보드 언어 사용</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert scroll direction on this computer</source>
|
||||
<translation>이 컴퓨터의 스크롤 방향 반전</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scroll Speed</source>
|
||||
<translation>스크롤 속도</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>App</source>
|
||||
<translation>앱</translation>
|
||||
|
|
@ -1323,6 +1315,14 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Include version in the window title</source>
|
||||
<translation type="unfinished">창 제목에 버전 정보 포함</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert vertical scroll direction on this computer</source>
|
||||
<translation type="unfinished">이 컴퓨터에서 세로 스크롤 방향을 반전합니다</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Vertical Scroll Scale</source>
|
||||
<translation type="unfinished">수직 스크롤 스케일</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>i18n</name>
|
||||
|
|
|
|||
|
|
@ -1111,14 +1111,6 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Use server's keyboard language on this computer</source>
|
||||
<translation>Использовать язык клавиатуры сервера на этом компьютере</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert scroll direction on this computer</source>
|
||||
<translation>Инвертировать направление прокрутки на этом компьютере</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scroll Speed</source>
|
||||
<translation>Скорость прокрутки</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>App</source>
|
||||
<translation>Приложение</translation>
|
||||
|
|
@ -1323,6 +1315,14 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Include version in the window title</source>
|
||||
<translation type="unfinished">Включить номер версии в заголовок окна</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert vertical scroll direction on this computer</source>
|
||||
<translation type="unfinished">Инвертировать направление вертикальной прокрутки на этом компьютере</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Vertical Scroll Scale</source>
|
||||
<translation type="unfinished">Вертикальная шкала прокрутки</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>i18n</name>
|
||||
|
|
|
|||
|
|
@ -1113,14 +1113,6 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Use server's keyboard language on this computer</source>
|
||||
<translation>在此计算机上使用服务器的键盘语言</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert scroll direction on this computer</source>
|
||||
<translation>反转此计算机上的滚动方向</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Scroll Speed</source>
|
||||
<translation>滚动速度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>App</source>
|
||||
<translation>应用程序</translation>
|
||||
|
|
@ -1325,6 +1317,14 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Include version in the window title</source>
|
||||
<translation type="unfinished">在窗口标题中包含版本信息</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invert vertical scroll direction on this computer</source>
|
||||
<translation type="unfinished">在此计算机上反转垂直滚动方向</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Vertical Scroll Scale</source>
|
||||
<translation type="unfinished">垂直滚动比例</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>i18n</name>
|
||||
|
|
|
|||
Loading…
Reference in a new issue