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
4500bcd5
Commit
4500bcd5
authored
5 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Use spacing for layouting settings
parent
8aaf7e9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/UserSettingsPage.cpp
+6
-26
6 additions, 26 deletions
src/UserSettingsPage.cpp
src/UserSettingsPage.h
+0
-1
0 additions, 1 deletion
src/UserSettingsPage.h
with
6 additions
and
27 deletions
src/UserSettingsPage.cpp
+
6
−
26
View file @
4500bcd5
...
...
@@ -331,9 +331,14 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
QScroller
::
grabGesture
(
scrollArea_
,
QScroller
::
TouchGesture
);
auto
spacingAroundForm
=
new
QHBoxLayout
;
spacingAroundForm
->
addStretch
(
1
);
spacingAroundForm
->
addLayout
(
formLayout_
,
0
);
spacingAroundForm
->
addStretch
(
1
);
auto
scrollAreaContents_
=
new
QWidget
{
this
};
scrollAreaContents_
->
setObjectName
(
"UserSettingScrollWidget"
);
scrollAreaContents_
->
setLayout
(
formLayout_
);
scrollAreaContents_
->
setLayout
(
spacingAroundForm
);
scrollArea_
->
setWidget
(
scrollAreaContents_
);
topLayout_
->
addLayout
(
topBarLayout_
);
...
...
@@ -432,31 +437,6 @@ UserSettingsPage::showEvent(QShowEvent *)
utils
::
humanReadableFingerprint
(
olm
::
client
()
->
identity_keys
().
ed25519
));
}
void
UserSettingsPage
::
resizeEvent
(
QResizeEvent
*
event
)
{
auto
preWidth
=
width
();
// based on the width of the widest item currently in the layout
// deviceFingerprintValue_ used for recalculating the margins of
// the formLayout_ on resize to help with small screens and mobile devices.
double
minFormWidth
=
deviceFingerprintValue_
->
width
();
if
(
preWidth
*
0.5
>
minFormWidth
)
sideMargin_
=
preWidth
*
0.25
;
else
sideMargin_
=
static_cast
<
double
>
(
preWidth
-
minFormWidth
)
/
2.
;
if
(
sideMargin_
<
60
)
sideMargin_
=
0
;
formLayout_
->
setContentsMargins
(
sideMargin_
,
LayoutTopMargin
,
sideMargin_
,
LayoutBottomMargin
);
QWidget
::
resizeEvent
(
event
);
}
void
UserSettingsPage
::
paintEvent
(
QPaintEvent
*
)
{
...
...
This diff is collapsed.
Click to expand it.
src/UserSettingsPage.h
+
0
−
1
View file @
4500bcd5
...
...
@@ -152,7 +152,6 @@ public:
protected:
void
showEvent
(
QShowEvent
*
event
)
override
;
void
resizeEvent
(
QResizeEvent
*
event
)
override
;
void
paintEvent
(
QPaintEvent
*
event
)
override
;
signals:
...
...
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