Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask-vpn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Vladimir KozLove
bitmask-vpn
Commits
ab6360dd
Unverified
Commit
ab6360dd
authored
3 years ago
by
Kali Kaneko
Browse files
Options
Downloads
Patches
Plain Diff
[ui] round boxes for preferences
parent
a2ef9f1e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gui/components/Preferences.qml
+117
-51
117 additions, 51 deletions
gui/components/Preferences.qml
with
117 additions
and
51 deletions
gui/components/Preferences.qml
+
117
−
51
View file @
ab6360dd
import
QtQuick
2.9
import
QtQuick
.
Controls
2.2
import
QtQuick
.
Layouts
1.14
import
QtQuick
.
Controls
.
Material
2.1
import
"
../themes/themes.js
"
as
Theme
...
...
@@ -7,69 +8,130 @@ import "../themes/themes.js" as Theme
ThemedPage
{
title
:
qsTr
(
"
Preferences
"
)
Column
{
id
:
prefCol
// FIXME checkboxes in Material style force lineHeights too big.
// need to override the style
// See: https://bugreports.qt.io/browse/QTBUG-95385
topPadding
:
root
.
width
*
0.05
leftPadding
:
root
.
width
*
0.1
rightPadding
:
root
.
width
*
0.15
// TODO - convert "boxed" themedpage with white background into
// a QML template.
Rectangle
{
id
:
turnOffWarning
visible
:
false
height
:
40
width
:
300
color
:
Theme
.
bgColor
Rectangle
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
width
:
root
.
appWidth
*
0.80
// FIXME - just the needed height
height
:
getBoxHeight
()
radius
:
10
color
:
"
white
"
anchors
{
fill
:
parent
margins
:
10
}
ColumnLayout
{
id
:
prefCol
width
:
root
.
appWidth
*
0.80
// FIXME checkboxes in Material style force lineHeights too big.
// need to override the style
// See: https://bugreports.qt.io/browse/QTBUG-95385
Rectangle
{
id
:
turnOffWarning
visible
:
false
height
:
40
width
:
parent
.
width
color
:
Theme
.
bgColor
Label
{
color
:
"
red
"
text
:
qsTr
(
"
Turn off the VPN to make changes
"
)
width
:
prefCol
.
width
}
Layout.topMargin
:
10
Layout.leftMargin
:
10
Layout.rightMargin
:
10
}
anchors.horizontalCenter
:
parent
.
horizontalCenter
Label
{
color
:
"
red
"
text
:
qsTr
(
"
Turn off the VPN to make changes
"
)
width
:
prefCol
.
width
id
:
circumLabel
text
:
qsTr
(
"
Censorship circumvention
"
)
font.bold
:
true
Layout.topMargin
:
10
Layout.leftMargin
:
10
Layout.rightMargin
:
10
}
}
Label
{
text
:
qsTr
(
"
These techniques can bypass censorship, but are slower. Please use them only if needed.
"
)
color
:
"
gray
"
visible
:
true
wrapMode
:
Text
.
Wrap
font.pixelSize
:
Theme
.
fontSize
-
3
Layout.leftMargin
:
10
Layout.rightMargin
:
10
Layout.preferredWidth
:
240
}
Label
{
text
:
qsTr
(
"
Anti-censorship
"
)
font.bold
:
true
}
CheckBox
{
id
:
useBridgesCheckBox
checked
:
false
text
:
qsTr
(
"
Use obfs4 bridges
"
)
// TODO refactor - this sets wrapMode on checkbox
contentItem
:
Label
{
text
:
useBridgesCheckBox
.
text
font
:
useBridgesCheckBox
.
font
horizontalAlignment
:
Text
.
AlignLeft
verticalAlignment
:
Text
.
AlignVCenter
leftPadding
:
useBridgesCheckBox
.
indicator
.
width
+
useBridgesCheckBox
.
spacing
wrapMode
:
Label
.
Wrap
}
Layout.leftMargin
:
10
Layout.rightMargin
:
10
onClicked
:
{
// TODO there's a corner case that needs to be dealt with in the backend,
// if an user has a manual location selected and switches to bridges:
// we need to fallback to "auto" selection if such location does not
// offer bridges
useBridges
(
checked
)
}
}
CheckBox
{
id
:
useBridgesCheckBox
checked
:
false
text
:
qsTr
(
"
Use obfs4 bridges
"
)
onClicked
:
{
// TODO there's a corner case that needs to be dealt with in the backend,
// if an user has a manual location selected and switches to bridges:
// we need to fallback to "auto" selection if such location does not
// offer bridges
useBridges
(
checked
)
CheckBox
{
id
:
useSnowflake
//wrapMode: Label.Wrap
text
:
qsTr
(
"
Use Snowflake (experimental)
"
)
enabled
:
false
checked
:
false
Layout.leftMargin
:
10
Layout.rightMargin
:
10
}
}
CheckBox
{
id
:
useSnowflake
text
:
qsTr
(
"
Use Snowflake (experimental)
"
)
enabled
:
false
checked
:
false
}
Label
{
text
:
qsTr
(
"
Transport
"
)
font.bold
:
true
Layout.leftMargin
:
10
Layout.rightMargin
:
10
}
Label
{
text
:
qsTr
(
"
Transport
"
)
font.bold
:
true
}
Label
{
text
:
qsTr
(
"
UDP can make the VPN faster
"
)
width
:
parent
.
width
color
:
"
gray
"
visible
:
true
wrapMode
:
Text
.
Wrap
font.pixelSize
:
Theme
.
fontSize
-
3
Layout.leftMargin
:
10
Layout.rightMargin
:
10
}
CheckBox
{
id
:
useUDP
text
:
qsTr
(
"
UDP
"
)
enabled
:
false
checked
:
false
onClicked
:
{
doUseUDP
(
checked
)
CheckBox
{
id
:
useUDP
text
:
qsTr
(
"
UDP
"
)
enabled
:
false
checked
:
false
Layout.leftMargin
:
10
Layout.rightMargin
:
10
onClicked
:
{
doUseUDP
(
checked
)
}
}
}
}
...
...
@@ -145,6 +207,10 @@ ThemedPage {
}
}
function
getBoxHeight
()
{
return
prefCol
.
height
+
15
}
Component.onCompleted
:
{
if
(
ctx
&&
ctx
.
transport
==
"
obfs4
"
)
{
useBridgesCheckBox
.
checked
=
true
...
...
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