Skip to content

Commit

Permalink
Version 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Desktop Commit Bot committed Aug 25, 2021
1 parent 5acc501 commit 508b67e
Show file tree
Hide file tree
Showing 284 changed files with 16,297 additions and 22,655 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

### v3.0.0
* Redesigned the Settings window to improve categorization and allow for future growth
* Separated the three “Kill Switch” setting choices into two separate settings - “VPN Kill Switch” and “Advanced Kill Switch”
* Automation rule triggers on the dashboard are now removed if the rule is deleted
* The “Usage” tile now adjusts units based on the amount of data transferred
* Fixed navigation order issues with VoiceOver on macOS in some Settings pages
* Fixed navigation order of overlay dialogs in Settings window for Windows screen readers
* Fixed an issue causing overlay tips to stop working after removing an Automation rule

### v2.10.0
* Reduced memory and CPU usage of the graphical client
* Updated icons and graphics
Expand Down
2 changes: 2 additions & 0 deletions brands/pia/brandinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"deprecatedOpenVPNSettingsLink":"https://www.privateinternetaccess.com/helpdesk/kb/articles/removing-openvpn-handshake-and-authentication-settings",
"appExclusionsHelpLink":"https://www.privateinternetaccess.com/helpdesk/kb/articles/split-tunnel-app-examples",
"automationHelpLink":"https://www.privateinternetaccess.com/helpdesk/kb/articles/understanding-the-desktop-network-automation-feature",
"referFriendLink":"https://www.privateinternetaccess.com/refer-a-friend",
"getDedicatedIpLink":"https://www.privateinternetaccess.com/pages/client-control-panel/dedicated-ip",
"windowsProductGuid": "{33023371-7761-4F81-BBB1-0E0D0D175ACF}",
"windowsServiceName": "PrivateInternetAccessService",
"windowsWireguardServiceName": "PrivateInternetAccessWireguard",
Expand Down
4 changes: 3 additions & 1 deletion client/res/components/common/ClientNotifications.qml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ Item {
severity: severities.warning
links: [{
text: uiTr("Settings"),
clicked: function() {showConnectionPage()}
clicked: function() {showMultihopPage()}
}]
dismissible: false
timestampValue: Daemon.state.proxyUnreachable
Expand Down Expand Up @@ -682,6 +682,8 @@ Item {
signal showNetworkPage()
// Show the connection page
signal showConnectionPage()
// Show the multihop page
signal showMultihopPage()
// Show the help page
signal showHelpPage()
// Changelog (for the post-update notification)
Expand Down
7 changes: 7 additions & 0 deletions client/res/components/common/DecoratedWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ PiaWindow {
// have issues.)
property bool resizeable: false


// Whether this window needs to always be on top
property bool onTop: false

// The actual logical size of the window
readonly property real actualLogicalWidth: maxSize.effectiveSize.width
readonly property real actualLogicalHeight: maxSize.effectiveSize.height
Expand Down Expand Up @@ -85,6 +89,9 @@ PiaWindow {
flags |= Qt.WindowMaximizeButtonHint
else
flags |= Qt.MSWindowsFixedSizeDialogHint

if(onTop)
flags |= Qt.WindowStaysOnTopHint
return flags
}

Expand Down
118 changes: 88 additions & 30 deletions client/res/components/common/OverlayDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ import "../theme"
import "qrc:/javascript/util.js" as Util
import "qrc:/javascript/keyutil.js" as KeyUtil
import PIA.NativeAcc 1.0 as NativeAcc
import PIA.NativeHelpers 1.0

// This draws a themed dialog in the overlay layer of the current window.
// The window should be a SecondaryWindow; OverlayDialog uses its
// actualLogicalWidth and actualLogicalHeight properties to center itself
Dialog {
id: dialog

// The buttons at the bottom of the dialog. Each button in the array can be
// described in three ways:
Expand Down Expand Up @@ -81,6 +83,33 @@ Dialog {
// role if applicable.)
signal clicked(var button)

onAboutToShow: {
// Ensure the stacking order is correct, since it affects keyboard nav /
// accessibility.
// QQuickPopupItem doesn't ensure its footer is stacked after the content
// (otherwise all the buttons appear before the content in nav order)
NativeHelpers.itemStackAfter(dialog.contentItem, dialog.footer)
// Ensure all buttons in the button box are stacked correctly (most
// important on macOS where the button order is reversed)
// dialogButtonBox.contentItem is a ListView
dialogButtonBox.contentItem.forceLayout()
let priorItem
for(let i=0; i<dialogButtonBox.contentItem.count; ++i) {
let nextItem = dialogButtonBox.contentItem.itemAtIndex(i)
// Whenever we have a valid pair of items, stack them correctly, even if
// we skipped some positions due to empty entries in the ListView
if(priorItem && nextItem)
NativeHelpers.itemStackAfter(priorItem, nextItem)
// If we got an item, keep it in priorItem so we can stack the next item
// after it. In theory, any position in the ListView can be undefined,
// but that's unlikely for this one since it does not scroll. Even so,
// if some items were empty, we still stack all present items in the right
// order.
if(nextItem)
priorItem = nextItem
}
}

readonly property var defaultButtons: {
var dict = {};
dict[Dialog.Ok] = { text: uiTr("OK", "dialog button"), role: DialogButtonBox.AcceptRole };
Expand Down Expand Up @@ -141,8 +170,6 @@ Dialog {
return dict;
}

id: dialog

modal: true
parent: Overlay.overlay
Overlay.modal: Rectangle {
Expand All @@ -163,27 +190,34 @@ Dialog {

closePolicy: actualButtons.some(function(i) { return i.role === DialogButtonBox.RejectRole; }) ? Popup.CloseOnEscape : Popup.NoAutoClose;
opacity: 0.0
padding: 20
topPadding: 15
bottomPadding: 15
bottomPadding: 10
leftPadding: 25
rightPadding: 25
header: Rectangle {
color: Theme.popup.dialogFrameColor
implicitHeight: 40
color: "transparent"
implicitHeight: 50
// Use the titleText's right edge; add the left margin again for symmetry
implicitWidth: titleText.x * 2 + titleText.width
Text {
anchors.fill: parent
anchors.leftMargin: 20
anchors.rightMargin: 20
id: titleText
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: 25
text: dialog.title
font: dialog.font
color: Theme.popup.dialogTitleTextColor
font.pixelSize: 24
color: Theme.popup.dialogTextColor
font.bold: true
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
verticalAlignment: Text.AlignBottom
}
}
background: Rectangle {
color: Theme.popup.dialogBackgroundColor
border.width: 1
border.color: Theme.popup.dialogFrameColor
radius: 15
}
// Setting a DialogButtonBox as the 'footer' implicitly connects the button
// box's accepted(), rejected() and clicked() signals to handlers in the
Expand All @@ -206,45 +240,69 @@ Dialog {
alignment: Qt.AlignRight
background: null
padding: 20
topPadding: 15
spacing: 5
topPadding: 20
spacing: 10
Repeater {
model: dialog.actualButtons
delegate: Button {
id: dialogButton

readonly property var buttonModel: modelData
readonly property bool primaryButton: modelData.role === DialogButtonBox.AcceptRole

text: modelData.text
property int standardButton: modelData.code !== undefined ? modelData.code : DialogButtonBox.NoButton
DialogButtonBox.buttonRole: modelData.role !== undefined ? modelData.role : DialogButtonBox.AcceptRole
enabled: !buttonsDisabled[DialogButtonBox.buttonRole]
leftPadding: 20
rightPadding: 20
leftPadding: 22
rightPadding: 22
topPadding: 8
bottomPadding: 8
font.bold: modelData.role === DialogButtonBox.AcceptRole
background: Rectangle {
color: {
if (!enabled)
Theme.settings.inputButtonDisabledBackgroundColor
else if (parent.down)
Theme.settings.inputButtonPressedBackgroundColor
else
Theme.settings.inputButtonBackgroundColor
if(modelData.role === DialogButtonBox.AcceptRole) {
if (!enabled)
Theme.popup.acceptDisabledColor
else if (parent.down)
Theme.popup.acceptDownColor
else
Theme.popup.acceptBackgroundColor
} else {
if (!enabled)
Theme.settings.inputButtonDisabledBackgroundColor
else if (parent.down)
Theme.settings.buttonBorderColor
else
Theme.popup.dialogBackgroundColor
}
}
radius: 3
radius: height/2
border.width: 2
border.color: {
if (!enabled)
Theme.settings.inputButtonDisabledBorderColor
else if (parent.activeFocus)
Theme.settings.inputButtonFocusBorderColor
else
color
if(modelData.role === DialogButtonBox.AcceptRole) {
return "transparent"
} else {
if (!enabled)
Theme.settings.inputButtonDisabledBorderColor
else if (parent.activeFocus)
Theme.settings.buttonBorderColor
else
Theme.settings.buttonBorderColor
}
}
}
contentItem: Text {
text: parent.text
font: parent.font
color: parent.enabled ? Theme.settings.inputButtonTextColor : Theme.settings.inputButtonDisabledTextColor
color:{
if(parent.enabled) {
return parent.primaryButton ? Theme.settings.inputPrimaryButtonTextColor : Theme.settings.inputButtonTextColor
} else {
return parent.primaryButton ? Theme.settings.inputPrimaryButtonDisabledTextColor : Theme.settings.inputButtonDisabledTextColor

}
}
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
Expand Down
95 changes: 95 additions & 0 deletions client/res/components/common/SettingsButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Copyright (c) 2021 Private Internet Access, Inc.
//
// This file is part of the Private Internet Access Desktop Client.
//
// The Private Internet Access Desktop Client is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// The Private Internet Access Desktop Client is distributed in the hope that
// it will be useful, but WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with the Private Internet Access Desktop Client. If not, see
// <https://www.gnu.org/licenses/>.

import QtQuick 2.9
import QtQuick.Controls 2.3
import "../theme"
import "../common"
import "../core"
import "qrc:/javascript/keyutil.js" as KeyUtil
import PIA.NativeAcc 1.0 as NativeAcc

FocusScope {
id: linkItem

property string text
// Hiding the TextLink by setting the 'visible' property disables the
// MouseArea.
property string link: ""
property bool underlined: false
property bool horzCenter: false
property int verticalPadding: 8
property int horizontalPadding: 20
property string icon: ""
property int iconSize: 10
property int iconRightMargin: 8

signal clicked()
readonly property bool hasIcon: icon !== ""

implicitWidth: linkText.width + 2*horizontalPadding + !!hasIcon * (iconSize + iconRightMargin)
implicitHeight: linkText.height + 2*verticalPadding
Rectangle {
height: parent.implicitHeight
width: parent.implicitWidth
border.color: linkItem.enabled ? Theme.settings.buttonBorderColor : Theme.settings.disabledButtonBorderColor
radius: height/2
color: "transparent"
opacity: {
return linkMouseArea.containsMouse ? 0.8 : 1;
}

Image {
visible: hasIcon
source: hasIcon ? Theme.settings.buttonIcons[icon] : ""
width: iconSize
height: iconSize
x: horizontalPadding
anchors.verticalCenter: parent.verticalCenter
opacity: linkItem.enabled ? 1 : 0.6
}

Text {
id: linkText
color: Theme.dashboard.textColor
x: horizontalPadding + !!hasIcon * (iconSize + iconRightMargin)
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: Theme.login.linkTextPx
text: linkItem.text
font.underline: false
opacity: linkItem.enabled ? 1 : 0.6
}
GenericButtonArea {
id: linkMouseArea
anchors.fill: parent

NativeAcc.Link.name: linkItem.text
NativeAcc.Link.onActivated: mouseClicked()

enabled: linkItem.visible && linkItem.enabled
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onClicked: {
if(link.length > 0) {
Qt.openUrlExternally(linkItem.link)
}
linkItem.clicked()
}
}
}
}
3 changes: 2 additions & 1 deletion client/res/components/common/TableBase.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Rectangle {
// bind the content height to the layout's implicit height.
property int contentWidth: tableBase.width
property int contentHeight: tableBase.height
property bool hideTableFocusCue: false

// Contents are placed inside the scroll view's Flickable
default property alias listContent: scrollViewContent.data
Expand Down Expand Up @@ -260,7 +261,7 @@ Rectangle {
anchors.fill: parent
control: tableBase
// Fade - the rows/cells also show a focus cue
opacity: 0.6
opacity: hideTableFocusCue ? 0 : 0.6
}

NativeAcc.Table.name: label
Expand Down
Loading

0 comments on commit 508b67e

Please sign in to comment.