Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
3172811c
Commit
3172811c
authored
4 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Add mobile mode which improves scrolling
parent
53734607
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/qml/MatrixText.qml
+1
-1
1 addition, 1 deletion
resources/qml/MatrixText.qml
src/UserSettingsPage.cpp
+21
-0
21 additions, 0 deletions
src/UserSettingsPage.cpp
src/UserSettingsPage.h
+6
-0
6 additions, 0 deletions
src/UserSettingsPage.h
with
28 additions
and
1 deletion
resources/qml/MatrixText.qml
+
1
−
1
View file @
3172811c
...
...
@@ -6,7 +6,7 @@ TextEdit {
textFormat
:
TextEdit
.
RichText
readOnly
:
true
wrapMode
:
Text
.
Wrap
selectByMouse
:
tru
e
selectByMouse
:
!
Settings
.
mobileMod
e
color
:
colors
.
text
onLinkActivated
:
{
if
(
/^https:
\/\/
matrix.to
\/
#
\/(
@.*
)
$/
.
test
(
link
))
{
...
...
This diff is collapsed.
Click to expand it.
src/UserSettingsPage.cpp
+
21
−
0
View file @
3172811c
...
...
@@ -75,6 +75,7 @@ UserSettings::load()
decryptSidebar_
=
settings
.
value
(
"user/decrypt_sidebar"
,
true
).
toBool
();
shareKeysWithTrustedUsers_
=
settings
.
value
(
"user/share_keys_with_trusted_users"
,
true
).
toBool
();
mobileMode_
=
settings
.
value
(
"user/mobile_mode"
,
false
).
toBool
();
emojiFont_
=
settings
.
value
(
"user/emoji_font_family"
,
"default"
).
toString
();
baseFontSize_
=
settings
.
value
(
"user/font_size"
,
QFont
().
pointSizeF
()).
toDouble
();
presence_
=
...
...
@@ -123,6 +124,16 @@ UserSettings::setStartInTray(bool state)
save
();
}
void
UserSettings
::
setMobileMode
(
bool
state
)
{
if
(
state
==
mobileMode_
)
return
;
mobileMode_
=
state
;
emit
mobileModeChanged
(
state
);
save
();
}
void
UserSettings
::
setGroupView
(
bool
state
)
{
...
...
@@ -389,6 +400,7 @@ UserSettings::save()
settings
.
setValue
(
"avatar_circles"
,
avatarCircles_
);
settings
.
setValue
(
"decrypt_sidebar"
,
decryptSidebar_
);
settings
.
setValue
(
"share_keys_with_trusted_users"
,
shareKeysWithTrustedUsers_
);
settings
.
setValue
(
"mobile_mode"
,
mobileMode_
);
settings
.
setValue
(
"font_size"
,
baseFontSize_
);
settings
.
setValue
(
"typing_notifications"
,
typingNotifications_
);
settings
.
setValue
(
"minor_events"
,
sortByImportance_
);
...
...
@@ -470,6 +482,7 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
desktopNotifications_
=
new
Toggle
{
this
};
alertOnNotification_
=
new
Toggle
{
this
};
useStunServer_
=
new
Toggle
{
this
};
mobileMode_
=
new
Toggle
{
this
};
scaleFactorCombo_
=
new
QComboBox
{
this
};
fontSizeCombo_
=
new
QComboBox
{
this
};
fontSelectionCombo_
=
new
QFontComboBox
{
this
};
...
...
@@ -637,6 +650,9 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
formLayout_
->
addRow
(
uiLabel_
);
formLayout_
->
addRow
(
new
HorizontalLine
{
this
});
boxWrap
(
tr
(
"Mobile mode"
),
mobileMode_
,
tr
(
"Will prevent text selection in the timeline to make scrolling easier."
));
#if !defined(Q_OS_MAC)
boxWrap
(
tr
(
"Scale factor"
),
scaleFactorCombo_
,
...
...
@@ -728,6 +744,10 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
settings_
->
setStartInTray
(
!
disabled
);
});
connect
(
mobileMode_
,
&
Toggle
::
toggled
,
this
,
[
this
](
bool
disabled
)
{
settings_
->
setMobileMode
(
!
disabled
);
});
connect
(
groupViewToggle_
,
&
Toggle
::
toggled
,
this
,
[
this
](
bool
disabled
)
{
settings_
->
setGroupView
(
!
disabled
);
});
...
...
@@ -820,6 +840,7 @@ UserSettingsPage::showEvent(QShowEvent *)
typingNotifications_
->
setState
(
!
settings_
->
typingNotifications
());
sortByImportance_
->
setState
(
!
settings_
->
sortByImportance
());
timelineButtonsToggle_
->
setState
(
!
settings_
->
buttonsInTimeline
());
mobileMode_
->
setState
(
!
settings_
->
mobileMode
());
readReceipts_
->
setState
(
!
settings_
->
readReceipts
());
markdown_
->
setState
(
!
settings_
->
markdown
());
desktopNotifications_
->
setState
(
!
settings_
->
hasDesktopNotifications
());
...
...
This diff is collapsed.
Click to expand it.
src/UserSettingsPage.h
+
6
−
0
View file @
3172811c
...
...
@@ -67,6 +67,7 @@ class UserSettings : public QObject
decryptSidebarChanged
)
Q_PROPERTY
(
int
timelineMaxWidth
READ
timelineMaxWidth
WRITE
setTimelineMaxWidth
NOTIFY
timelineMaxWidthChanged
)
Q_PROPERTY
(
bool
mobileMode
READ
mobileMode
WRITE
setMobileMode
NOTIFY
mobileModeChanged
)
Q_PROPERTY
(
double
fontSize
READ
fontSize
WRITE
setFontSize
NOTIFY
fontSizeChanged
)
Q_PROPERTY
(
QString
font
READ
font
WRITE
setFontFamily
NOTIFY
fontChanged
)
Q_PROPERTY
(
...
...
@@ -99,6 +100,7 @@ public:
void
setEnlargeEmojiOnlyMessages
(
bool
state
);
void
setTray
(
bool
state
);
void
setStartInTray
(
bool
state
);
void
setMobileMode
(
bool
mode
);
void
setFontSize
(
double
size
);
void
setFontFamily
(
QString
family
);
void
setEmojiFontFamily
(
QString
family
);
...
...
@@ -130,6 +132,7 @@ public:
bool
typingNotifications
()
const
{
return
typingNotifications_
;
}
bool
sortByImportance
()
const
{
return
sortByImportance_
;
}
bool
buttonsInTimeline
()
const
{
return
buttonsInTimeline_
;
}
bool
mobileMode
()
const
{
return
mobileMode_
;
}
bool
readReceipts
()
const
{
return
readReceipts_
;
}
bool
hasDesktopNotifications
()
const
{
return
hasDesktopNotifications_
;
}
bool
hasAlertOnNotification
()
const
{
return
hasAlertOnNotification_
;
}
...
...
@@ -163,6 +166,7 @@ signals:
void
avatarCirclesChanged
(
bool
state
);
void
decryptSidebarChanged
(
bool
state
);
void
timelineMaxWidthChanged
(
int
state
);
void
mobileModeChanged
(
bool
mode
);
void
fontSizeChanged
(
double
state
);
void
fontChanged
(
QString
state
);
void
emojiFontChanged
(
QString
state
);
...
...
@@ -193,6 +197,7 @@ private:
bool
avatarCircles_
;
bool
decryptSidebar_
;
bool
shareKeysWithTrustedUsers_
;
bool
mobileMode_
;
int
timelineMaxWidth_
;
double
baseFontSize_
;
QString
font_
;
...
...
@@ -256,6 +261,7 @@ private:
Toggle
*
useStunServer_
;
Toggle
*
decryptSidebar_
;
Toggle
*
shareKeysWithTrustedUsers_
;
Toggle
*
mobileMode_
;
QLabel
*
deviceFingerprintValue_
;
QLabel
*
deviceIdValue_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment