Improve UI

pull/11/head
cutefishd 5 years ago
parent 3c61f2ae7c
commit 2282ab14cc

@ -36,6 +36,10 @@ ItemPage {
rightPadding: FishUI.Units.largeSpacing * 2 rightPadding: FishUI.Units.largeSpacing * 2
} }
Item {
height: FishUI.Units.largeSpacing
}
// Label { // Label {
// text: qsTr("Built on ") + about.prettyProductName // text: qsTr("Built on ") + about.prettyProductName
// Layout.alignment: Qt.AlignTop | Qt.AlignHCenter // Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
@ -43,34 +47,36 @@ ItemPage {
// color: FishUI.Theme.disabledTextColor // color: FishUI.Theme.disabledTextColor
// } // }
StandardItem { RoundedItem {
key: qsTr("System Version") StandardItem {
value: "0.2" key: qsTr("System Version")
} value: "0.2"
}
StandardItem { StandardItem {
key: qsTr("System Type") key: qsTr("System Type")
value: about.architecture value: about.architecture
} }
StandardItem { StandardItem {
key: qsTr("Kernel Version") key: qsTr("Kernel Version")
value: about.kernelVersion value: about.kernelVersion
} }
StandardItem { StandardItem {
key: qsTr("Processor") key: qsTr("Processor")
value: about.cpuInfo value: about.cpuInfo
} }
StandardItem { StandardItem {
key: qsTr("RAM") key: qsTr("RAM")
value: about.memorySize value: about.memorySize
} }
StandardItem { StandardItem {
key: qsTr("Internal Storage") key: qsTr("Internal Storage")
value: about.internalStorage value: about.internalStorage
}
} }
} }
} }

@ -32,41 +32,44 @@ ItemPage {
id: layout id: layout
anchors.fill: parent anchors.fill: parent
ListView { RoundedItem {
id: _userView
model: userModel
Layout.fillWidth: true
spacing: FishUI.Units.largeSpacing
interactive: false
Layout.preferredHeight: { ListView {
var totalHeight = 0 id: _userView
for (var i = 0; i < _userView.visibleChildren.length; ++i) { model: userModel
totalHeight += _userView.visibleChildren[i].height Layout.fillWidth: true
spacing: FishUI.Units.largeSpacing
interactive: false
Layout.preferredHeight: {
var totalHeight = 0
for (var i = 0; i < _userView.visibleChildren.length; ++i) {
totalHeight += _userView.visibleChildren[i].height
}
totalHeight += (_userView.count - 1) * _userView.spacing
return totalHeight
} }
totalHeight += (_userView.count - 1) * _userView.spacing
return totalHeight
}
property int itemHeight: 64 property int itemHeight: 64
delegate: UserDelegateItem { delegate: UserDelegateItem {
width: _userView.width width: _userView.width
}
} }
}
Item { Item {
height: FishUI.Units.smallSpacing height: FishUI.Units.smallSpacing
} }
Button { Button {
id: _addUserButton id: _addUserButton
text: qsTr("Add user") text: qsTr("Add user")
onClicked: { onClicked: {
var component = Qt.createComponent("AddUserDialog.qml") var component = Qt.createComponent("AddUserDialog.qml")
if (component.status === Component.Ready) { if (component.status === Component.Ready) {
var dialog = component.createObject(rootWindow) var dialog = component.createObject(rootWindow)
dialog.open() dialog.open()
}
} }
} }
} }

@ -47,234 +47,237 @@ ItemPage {
id: layout id: layout
anchors.fill: parent anchors.fill: parent
anchors.bottomMargin: FishUI.Units.largeSpacing anchors.bottomMargin: FishUI.Units.largeSpacing
spacing: FishUI.Units.largeSpacing * 2
Label { RoundedItem {
text: qsTr("Theme") Label {
color: FishUI.Theme.disabledTextColor text: qsTr("Theme")
bottomPadding: FishUI.Units.smallSpacing color: FishUI.Theme.disabledTextColor
} bottomPadding: FishUI.Units.smallSpacing
// Light Mode and Dark Mode
RowLayout {
spacing: FishUI.Units.largeSpacing * 2
IconCheckBox {
source: "qrc:/images/light_mode.svg"
text: qsTr("Light")
checked: !FishUI.Theme.darkMode
onClicked: appearance.switchDarkMode(false)
} }
IconCheckBox { // Light Mode and Dark Mode
source: "qrc:/images/dark_mode.svg" RowLayout {
text: qsTr("Dark") spacing: FishUI.Units.largeSpacing * 2
checked: FishUI.Theme.darkMode
onClicked: appearance.switchDarkMode(true)
}
}
Item { IconCheckBox {
height: FishUI.Units.largeSpacing source: "qrc:/images/light_mode.svg"
} text: qsTr("Light")
checked: !FishUI.Theme.darkMode
RowLayout { onClicked: appearance.switchDarkMode(false)
spacing: FishUI.Units.largeSpacing }
Label { IconCheckBox {
id: dimsTipsLabel source: "qrc:/images/dark_mode.svg"
text: qsTr("Dim the wallpaper in dark theme") text: qsTr("Dark")
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft checked: FishUI.Theme.darkMode
onClicked: appearance.switchDarkMode(true)
}
} }
Item { Item {
Layout.fillWidth: true height: FishUI.Units.largeSpacing
} }
Switch { RowLayout {
checked: appearance.dimsWallpaper spacing: FishUI.Units.largeSpacing
height: dimsTipsLabel.height
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Label {
onCheckedChanged: appearance.setDimsWallpaper(checked) id: dimsTipsLabel
} text: qsTr("Dim the wallpaper in dark theme")
} Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
}
HorizontalDivider {} Item {
Layout.fillWidth: true
}
Label { Switch {
text: qsTr("Accent color") checked: appearance.dimsWallpaper
color: FishUI.Theme.disabledTextColor height: dimsTipsLabel.height
bottomPadding: FishUI.Units.smallSpacing Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
onCheckedChanged: appearance.setDimsWallpaper(checked)
}
}
} }
GridView { RoundedItem {
id: accentColorView Label {
height: itemSize + FishUI.Units.largeSpacing * 2 text: qsTr("Accent color")
Layout.fillWidth: true color: FishUI.Theme.disabledTextColor
cellWidth: height bottomPadding: FishUI.Units.smallSpacing
cellHeight: height
interactive: false
model: ListModel {}
property var itemSize: 32
Component.onCompleted: {
model.append({"accentColor": String(FishUI.Theme.blueColor)})
model.append({"accentColor": String(FishUI.Theme.redColor)})
model.append({"accentColor": String(FishUI.Theme.greenColor)})
model.append({"accentColor": String(FishUI.Theme.purpleColor)})
model.append({"accentColor": String(FishUI.Theme.pinkColor)})
model.append({"accentColor": String(FishUI.Theme.orangeColor)})
} }
delegate: Rectangle { GridView {
property bool checked: Qt.colorEqual(FishUI.Theme.highlightColor, accentColor) id: accentColorView
property color currentColor: accentColor height: itemSize + FishUI.Units.largeSpacing * 2
Layout.fillWidth: true
width: accentColorView.itemSize + FishUI.Units.largeSpacing cellWidth: height
height: width cellHeight: height
color: "transparent" interactive: false
radius: width / 2 model: ListModel {}
border.color: _mouseArea.pressed ? Qt.rgba(currentColor.r,
currentColor.g, property var itemSize: 32
currentColor.b, 0.6)
: Qt.rgba(currentColor.r, Component.onCompleted: {
currentColor.g, model.append({"accentColor": String(FishUI.Theme.blueColor)})
currentColor.b, 0.4) model.append({"accentColor": String(FishUI.Theme.redColor)})
border.width: checked ? 3 : _mouseArea.containsMouse ? 2 : 0 model.append({"accentColor": String(FishUI.Theme.greenColor)})
model.append({"accentColor": String(FishUI.Theme.purpleColor)})
MouseArea { model.append({"accentColor": String(FishUI.Theme.pinkColor)})
id: _mouseArea model.append({"accentColor": String(FishUI.Theme.orangeColor)})
anchors.fill: parent
hoverEnabled: true
onClicked: appearance.setAccentColor(index)
} }
Rectangle { delegate: Rectangle {
width: 32 property bool checked: Qt.colorEqual(FishUI.Theme.highlightColor, accentColor)
property color currentColor: accentColor
width: accentColorView.itemSize + FishUI.Units.largeSpacing
height: width height: width
anchors.centerIn: parent color: "transparent"
color: currentColor
radius: width / 2 radius: width / 2
border.color: _mouseArea.pressed ? Qt.rgba(currentColor.r,
currentColor.g,
currentColor.b, 0.6)
: Qt.rgba(currentColor.r,
currentColor.g,
currentColor.b, 0.4)
border.width: checked ? 3 : _mouseArea.containsMouse ? 2 : 0
MouseArea {
id: _mouseArea
anchors.fill: parent
hoverEnabled: true
onClicked: appearance.setAccentColor(index)
}
Image { Rectangle {
anchors.centerIn: parent width: 32
width: parent.height * 0.5
height: width height: width
sourceSize: Qt.size(width, height) anchors.centerIn: parent
source: "qrc:/images/checked.svg" color: currentColor
visible: checked radius: width / 2
ColorOverlay { Image {
anchors.fill: parent anchors.centerIn: parent
source: parent width: parent.height * 0.5
color: FishUI.Theme.highlightedTextColor height: width
opacity: 1 sourceSize: Qt.size(width, height)
visible: true source: "qrc:/images/checked.svg"
visible: checked
ColorOverlay {
anchors.fill: parent
source: parent
color: FishUI.Theme.highlightedTextColor
opacity: 1
visible: true
}
} }
} }
} }
} }
} }
HorizontalDivider {} RoundedItem {
// Font
// Font
Label {
text: qsTr("Font")
color: FishUI.Theme.disabledTextColor
bottomPadding: FishUI.Units.smallSpacing
}
GridLayout {
rows: 3
columns: 2
columnSpacing: FishUI.Units.largeSpacing * 2
Label { Label {
text: qsTr("General Font") text: qsTr("Font")
color: FishUI.Theme.disabledTextColor
bottomPadding: FishUI.Units.smallSpacing bottomPadding: FishUI.Units.smallSpacing
} }
ComboBox { GridLayout {
id: generalFontComboBox rows: 3
model: fontsModel.generalFonts columns: 2
enabled: true
Layout.fillWidth: true
onActivated: appearance.setGenericFontFamily(currentText)
}
Label { columnSpacing: FishUI.Units.largeSpacing * 2
text: qsTr("Fixed Font")
bottomPadding: FishUI.Units.smallSpacing
}
ComboBox {
id: fixedFontComboBox
model: fontsModel.fixedFonts
enabled: true
Layout.fillWidth: true
onActivated: appearance.setFixedFontFamily(currentText)
}
Label {
text: qsTr("Font Size")
bottomPadding: FishUI.Units.smallSpacing
}
TabBar { Label {
Layout.fillWidth: true text: qsTr("General Font")
bottomPadding: FishUI.Units.smallSpacing
}
TabButton { ComboBox {
text: qsTr("Small") id: generalFontComboBox
model: fontsModel.generalFonts
enabled: true
Layout.fillWidth: true
onActivated: appearance.setGenericFontFamily(currentText)
} }
TabButton { Label {
text: qsTr("Medium") text: qsTr("Fixed Font")
bottomPadding: FishUI.Units.smallSpacing
} }
TabButton { ComboBox {
text: qsTr("Large") id: fixedFontComboBox
model: fontsModel.fixedFonts
enabled: true
Layout.fillWidth: true
onActivated: appearance.setFixedFontFamily(currentText)
} }
TabButton { Label {
text: qsTr("Huge") text: qsTr("Font Size")
bottomPadding: FishUI.Units.smallSpacing
} }
currentIndex: { TabBar {
var index = 0 Layout.fillWidth: true
if (appearance.fontPointSize <= 10) TabButton {
index = 0 text: qsTr("Small")
else if (appearance.fontPointSize <= 11) }
index = 1
else if (appearance.fontPointSize <= 13)
index = 2
else if (appearance.fontPointSize <= 16)
index = 3
return index TabButton {
} text: qsTr("Medium")
}
TabButton {
text: qsTr("Large")
}
onCurrentIndexChanged: { TabButton {
var fontSize = 0 text: qsTr("Huge")
switch (currentIndex) {
case 0:
fontSize = 10
break;
case 1:
fontSize = 11
break;
case 2:
fontSize = 13
break;
case 3:
fontSize = 16
break;
} }
appearance.setFontPointSize(fontSize) currentIndex: {
var index = 0
if (appearance.fontPointSize <= 10)
index = 0
else if (appearance.fontPointSize <= 11)
index = 1
else if (appearance.fontPointSize <= 13)
index = 2
else if (appearance.fontPointSize <= 16)
index = 3
return index
}
onCurrentIndexChanged: {
var fontSize = 0
switch (currentIndex) {
case 0:
fontSize = 10
break;
case 1:
fontSize = 11
break;
case 2:
fontSize = 13
break;
case 3:
fontSize = 16
break;
}
appearance.setFontPointSize(fontSize)
}
} }
} }
} }

@ -44,7 +44,7 @@ ItemPage {
ColumnLayout { ColumnLayout {
id: layout id: layout
anchors.fill: parent anchors.fill: parent
spacing: FishUI.Units.largeSpacing spacing: FishUI.Units.largeSpacing * 2
// Battery Info // Battery Info
BatteryItem { BatteryItem {
@ -98,68 +98,68 @@ ItemPage {
} }
} }
Item { RoundedItem {
height: FishUI.Units.largeSpacing Label {
} text: qsTr("History")
color: FishUI.Theme.disabledTextColor
Label { }
text: qsTr("History")
color: FishUI.Theme.disabledTextColor
}
HistoryGraph { HistoryGraph {
Layout.fillWidth: true Layout.fillWidth: true
height: 300 height: 300
data: history.points data: history.points
readonly property real xTicksAtDontCare: 0 readonly property real xTicksAtDontCare: 0
readonly property real xTicksAtTwelveOClock: 1 readonly property real xTicksAtTwelveOClock: 1
readonly property real xTicksAtFullHour: 2 readonly property real xTicksAtFullHour: 2
readonly property real xTicksAtHalfHour: 3 readonly property real xTicksAtHalfHour: 3
readonly property real xTicksAtFullSecondHour: 4 readonly property real xTicksAtFullSecondHour: 4
readonly property real xTicksAtTenMinutes: 5 readonly property real xTicksAtTenMinutes: 5
readonly property var xTicksAtList: [xTicksAtTenMinutes, xTicksAtHalfHour, xTicksAtHalfHour, readonly property var xTicksAtList: [xTicksAtTenMinutes, xTicksAtHalfHour, xTicksAtHalfHour,
xTicksAtFullHour, xTicksAtFullSecondHour, xTicksAtTwelveOClock] xTicksAtFullHour, xTicksAtFullSecondHour, xTicksAtTwelveOClock]
// Set grid lines distances which directly correspondent to the xTicksAt variables // Set grid lines distances which directly correspondent to the xTicksAt variables
readonly property var xDivisionWidths: [1000 * 60 * 10, 1000 * 60 * 60 * 12, 1000 * 60 * 60, 1000 * 60 * 30, 1000 * 60 * 60 * 2, 1000 * 60 * 10] readonly property var xDivisionWidths: [1000 * 60 * 10, 1000 * 60 * 60 * 12, 1000 * 60 * 60, 1000 * 60 * 30, 1000 * 60 * 60 * 2, 1000 * 60 * 10]
xTicksAt: xTicksAtList[4] xTicksAt: xTicksAtList[4]
xDivisionWidth: xDivisionWidths[xTicksAt] xDivisionWidth: xDivisionWidths[xTicksAt]
xMin: history.firstDataPointTime xMin: history.firstDataPointTime
xMax: history.lastDataPointTime xMax: history.lastDataPointTime
xDuration: history.duration xDuration: history.duration
yUnits: batteryPage.historyType === BatteryHistoryModel.RateType ? qsTr("W") : "%" yUnits: batteryPage.historyType === BatteryHistoryModel.RateType ? qsTr("W") : "%"
yMax: { yMax: {
if (batteryPage.historyType === BatteryHistoryModel.RateType) { if (batteryPage.historyType === BatteryHistoryModel.RateType) {
// ceil to nearest 10 // ceil to nearest 10
var max = Math.floor(history.largestValue) var max = Math.floor(history.largestValue)
max = max - max % 10 + 10 max = max - max % 10 + 10
return max; return max;
} else { } else {
return 100; return 100;
}
} }
yStep: batteryPage.historyType === BatteryHistoryModel.RateType ? 10 : 20
visible: history.count > 1
} }
yStep: batteryPage.historyType === BatteryHistoryModel.RateType ? 10 : 20
visible: history.count > 1
} }
Item { RoundedItem {
height: FishUI.Units.smallSpacing StandardItem {
} key: qsTr("Last Charged to") + " " + battery.lastChargedPercent + "%"
value: battery.lastChargedTime
visible: battery.lastChargedPercent !== 0
}
StandardItem { StandardItem {
key: qsTr("Last Charged to") + " " + battery.lastChargedPercent + "%" key: qsTr("Maximum Capacity")
value: battery.lastChargedTime value: battery.capacity + "%"
visible: battery.lastChargedPercent !== 0 }
} }
StandardItem { Item {
key: qsTr("Maximum Capacity") height: FishUI.Units.largeSpacing
value: battery.capacity + "%"
} }
} }
} }

@ -35,256 +35,258 @@ ItemPage {
ColumnLayout { ColumnLayout {
id: layout id: layout
anchors.fill: parent anchors.fill: parent
spacing: FishUI.Units.largeSpacing * 2
Label { RoundedItem {
text: qsTr("Brightness") Layout.fillWidth: true
color: FishUI.Theme.disabledTextColor
bottomPadding: FishUI.Units.largeSpacing
visible: brightness.enabled
}
RowLayout {
spacing: FishUI.Units.largeSpacing
visible: brightness.enabled
Image { Label {
width: brightnessSlider.height text: qsTr("Brightness")
height: width color: FishUI.Theme.disabledTextColor
sourceSize.width: width bottomPadding: FishUI.Units.largeSpacing
sourceSize.height: height visible: brightness.enabled
source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark" : "light") + "/display-brightness-low-symbolic.svg"
} }
Slider { RowLayout {
id: brightnessSlider spacing: FishUI.Units.largeSpacing
Layout.fillWidth: true visible: brightness.enabled
value: brightness.value
from: 0
to: 100
stepSize: 1
onMoved: brightnessTimer.start()
}
Image { Image {
width: brightnessSlider.height width: brightnessSlider.height
height: width height: width
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark" : "light") + "/display-brightness-symbolic.svg" source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark" : "light") + "/display-brightness-low-symbolic.svg"
} }
}
Item { Slider {
height: FishUI.Units.largeSpacing id: brightnessSlider
visible: brightness.enabled Layout.fillWidth: true
} value: brightness.value
from: 0
to: 100
stepSize: 1
onMoved: brightnessTimer.start()
}
HorizontalDivider { Image {
visible: brightness.enabled width: brightnessSlider.height
} height: width
sourceSize.width: width
sourceSize.height: height
source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark" : "light") + "/display-brightness-symbolic.svg"
}
}
Label { Item {
text: qsTr("Screen") height: FishUI.Units.smallSpacing
color: FishUI.Theme.disabledTextColor }
bottomPadding: FishUI.Units.smallSpacing
visible: _screenView.count > 0
} }
ListView { RoundedItem {
id: _screenView Label {
Layout.fillWidth: true text: qsTr("Screen")
model: screen.outputModel color: FishUI.Theme.disabledTextColor
orientation: ListView.Horizontal bottomPadding: FishUI.Units.smallSpacing
interactive: false visible: _screenView.count > 0
clip: true }
Layout.preferredHeight: currentItem ? currentItem.layout.implicitHeight : 0 ListView {
id: _screenView
Layout.fillWidth: true
model: screen.outputModel
orientation: ListView.Horizontal
interactive: false
clip: true
delegate: Item { Layout.preferredHeight: currentItem ? currentItem.layout.implicitHeight : 0
id: screenItem
height: ListView.view.height
width: ListView.view.width
property var element: model delegate: Item {
property var layout: _mainLayout id: screenItem
height: ListView.view.height
width: ListView.view.width
ColumnLayout { property var element: model
id: _mainLayout property var layout: _mainLayout
anchors.fill: parent
// Label { ColumnLayout {
// text: element.display id: _mainLayout
// } anchors.fill: parent
GridLayout { // Label {
columns: 2 // text: element.display
columnSpacing: FishUI.Units.largeSpacing // }
rowSpacing: FishUI.Units.smallSpacing
Label { GridLayout {
text: qsTr("Resolution") columns: 2
} columnSpacing: FishUI.Units.largeSpacing
rowSpacing: FishUI.Units.smallSpacing
ComboBox { Label {
Layout.fillWidth: true text: qsTr("Resolution")
model: element.resolutions
currentIndex: element.resolutionIndex !== undefined ?
element.resolutionIndex : -1
onActivated: {
element.resolutionIndex = currentIndex
screen.save()
} }
}
Label { ComboBox {
text: qsTr("Refresh rate") Layout.fillWidth: true
} model: element.resolutions
currentIndex: element.resolutionIndex !== undefined ?
element.resolutionIndex : -1
onActivated: {
element.resolutionIndex = currentIndex
screen.save()
}
}
ComboBox { Label {
id: refreshRate text: qsTr("Refresh rate")
Layout.fillWidth: true
model: element.refreshRates
currentIndex: element.refreshRateIndex ?
element.refreshRateIndex : 0
onActivated: {
element.refreshRateIndex = currentIndex
screen.save()
} }
}
Label { ComboBox {
text: qsTr("Rotation") id: refreshRate
} Layout.fillWidth: true
model: element.refreshRates
currentIndex: element.refreshRateIndex ?
element.refreshRateIndex : 0
onActivated: {
element.refreshRateIndex = currentIndex
screen.save()
}
}
Item { Label {
id: rotationItem text: qsTr("Rotation")
Layout.fillWidth: true }
height: rotationLayout.implicitHeight
RowLayout { Item {
id: rotationLayout id: rotationItem
anchors.fill: parent Layout.fillWidth: true
height: rotationLayout.implicitHeight
RotationButton { RowLayout {
value: 0 id: rotationLayout
} anchors.fill: parent
RotationButton { RotationButton {
value: 90 value: 0
} }
RotationButton { RotationButton {
value: 180 value: 90
} }
RotationButton { RotationButton {
value: 270 value: 180
}
RotationButton {
value: 270
}
} }
} }
}
Label { Label {
text: qsTr("Enabled") text: qsTr("Enabled")
visible: enabledBox.visible visible: enabledBox.visible
} }
CheckBox { CheckBox {
id: enabledBox id: enabledBox
checked: element.enabled checked: element.enabled
visible: _screenView.count > 1 visible: _screenView.count > 1
onClicked: { onClicked: {
element.enabled = checked element.enabled = checked
screen.save() screen.save()
}
} }
} }
} }
} }
} }
}
PageIndicator { PageIndicator {
id: screenPageIndicator id: screenPageIndicator
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
count: _screenView.count count: _screenView.count
currentIndex: _screenView.currentIndex currentIndex: _screenView.currentIndex
onCurrentIndexChanged: _screenView.currentIndex = currentIndex onCurrentIndexChanged: _screenView.currentIndex = currentIndex
interactive: true interactive: true
visible: count > 1 visible: count > 1
} }
HorizontalDivider { }
Label {
text: qsTr("Scale")
color: FishUI.Theme.disabledTextColor
bottomPadding: FishUI.Units.smallSpacing
} }
TabBar { RoundedItem {
id: dockSizeTabbar Label {
Layout.fillWidth: true text: qsTr("Scale")
color: FishUI.Theme.disabledTextColor
TabButton { bottomPadding: FishUI.Units.smallSpacing
text: "100%"
} }
TabButton { TabBar {
text: "125%" id: dockSizeTabbar
} Layout.fillWidth: true
TabButton { TabButton {
text: "150%" text: "100%"
} }
TabButton { TabButton {
text: "175%" text: "125%"
} }
TabButton { TabButton {
text: "200%" text: "150%"
} }
currentIndex: { TabButton {
var index = 0 text: "175%"
}
if (appearance.devicePixelRatio <= 1.0)
index = 0
else if (appearance.devicePixelRatio <= 1.25)
index = 1
else if (appearance.devicePixelRatio <= 1.50)
index = 2
else if (appearance.devicePixelRatio <= 1.75)
index = 3
else if (appearance.devicePixelRatio <= 2.0)
index = 4
return index
}
onCurrentIndexChanged: { TabButton {
var value = 1.0 text: "200%"
switch (currentIndex) {
case 0:
value = 1.0
break;
case 1:
value = 1.25
break;
case 2:
value = 1.50
break;
case 3:
value = 1.75
break;
case 4:
value = 2.0
break;
} }
rootWindow.showPassiveNotification(qsTr("Need to log in again to take effect"), "short") currentIndex: {
var index = 0
if (appearance.devicePixelRatio <= 1.0)
index = 0
else if (appearance.devicePixelRatio <= 1.25)
index = 1
else if (appearance.devicePixelRatio <= 1.50)
index = 2
else if (appearance.devicePixelRatio <= 1.75)
index = 3
else if (appearance.devicePixelRatio <= 2.0)
index = 4
return index
}
appearance.setDevicePixelRatio(value) onCurrentIndexChanged: {
var value = 1.0
switch (currentIndex) {
case 0:
value = 1.0
break;
case 1:
value = 1.25
break;
case 2:
value = 1.50
break;
case 3:
value = 1.75
break;
case 4:
value = 2.0
break;
}
rootWindow.showPassiveNotification(qsTr("Need to log in again to take effect"), "short")
appearance.setDevicePixelRatio(value)
}
} }
} }

@ -18,102 +18,105 @@ ItemPage {
ColumnLayout { ColumnLayout {
id: layout id: layout
anchors.fill: parent anchors.fill: parent
spacing: FishUI.Units.largeSpacing * 2
// Dock
Label { RoundedItem {
text: qsTr("Position on screen") // Dock
color: FishUI.Theme.disabledTextColor Label {
bottomPadding: FishUI.Units.smallSpacing text: qsTr("Position on screen")
} color: FishUI.Theme.disabledTextColor
bottomPadding: FishUI.Units.smallSpacing
RowLayout {
spacing: FishUI.Units.largeSpacing * 2
IconCheckBox {
source: "qrc:/images/dock_left.svg"
text: qsTr("Left")
checked: appearance.dockDirection === 0
onClicked: appearance.setDockDirection(0)
} }
IconCheckBox { RowLayout {
source: "qrc:/images/dock_bottom.svg" spacing: FishUI.Units.largeSpacing * 2
text: qsTr("Bottom")
checked: appearance.dockDirection === 1
onClicked: appearance.setDockDirection(1)
}
IconCheckBox { IconCheckBox {
source: "qrc:/images/dock_right.svg" source: "qrc:/images/dock_left.svg"
text: qsTr("Right") text: qsTr("Left")
checked: appearance.dockDirection === 2 checked: appearance.dockDirection === 0
onClicked: appearance.setDockDirection(2) onClicked: appearance.setDockDirection(0)
} }
}
HorizontalDivider {} IconCheckBox {
source: "qrc:/images/dock_bottom.svg"
text: qsTr("Bottom")
checked: appearance.dockDirection === 1
onClicked: appearance.setDockDirection(1)
}
Label { IconCheckBox {
text: qsTr("Size") source: "qrc:/images/dock_right.svg"
color: FishUI.Theme.disabledTextColor text: qsTr("Right")
bottomPadding: FishUI.Units.smallSpacing checked: appearance.dockDirection === 2
onClicked: appearance.setDockDirection(2)
}
}
} }
TabBar { RoundedItem {
id: dockSizeTabbar Label {
Layout.fillWidth: true text: qsTr("Size")
bottomPadding: FishUI.Units.smallSpacing color: FishUI.Theme.disabledTextColor
bottomPadding: FishUI.Units.smallSpacing
TabButton {
text: qsTr("Small")
} }
TabButton { TabBar {
text: qsTr("Medium") id: dockSizeTabbar
} Layout.fillWidth: true
bottomPadding: FishUI.Units.smallSpacing
TabButton { TabButton {
text: qsTr("Large") text: qsTr("Small")
} }
TabButton { TabButton {
text: qsTr("Huge") text: qsTr("Medium")
} }
currentIndex: { TabButton {
var index = 0 text: qsTr("Large")
}
if (appearance.dockIconSize <= 50) TabButton {
index = 0 text: qsTr("Huge")
else if (appearance.dockIconSize <= 65) }
index = 1
else if (appearance.dockIconSize <= 90)
index = 2
else if (appearance.dockIconSize <= 130)
index = 3
return index currentIndex: {
} var index = 0
onCurrentIndexChanged: { if (appearance.dockIconSize <= 50)
var iconSize = 0 index = 0
else if (appearance.dockIconSize <= 65)
switch (currentIndex) { index = 1
case 0: else if (appearance.dockIconSize <= 90)
iconSize = 50 index = 2
break; else if (appearance.dockIconSize <= 130)
case 1: index = 3
iconSize = 65
break; return index
case 2:
iconSize = 90
break;
case 3:
iconSize = 130
break;
} }
appearance.setDockIconSize(iconSize) onCurrentIndexChanged: {
var iconSize = 0
switch (currentIndex) {
case 0:
iconSize = 50
break;
case 1:
iconSize = 65
break;
case 2:
iconSize = 90
break;
case 3:
iconSize = 130
break;
}
appearance.setDockIconSize(iconSize)
}
} }
} }

@ -54,9 +54,10 @@ Item {
ListView { ListView {
id: wirelessView id: wirelessView
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: itemHeight * count Layout.preferredHeight: itemHeight * count + ((count - 1) * FishUI.Units.smallSpacing)
clip: true clip: true
model: appletProxyModel model: appletProxyModel
spacing: FishUI.Units.smallSpacing
interactive: false interactive: false
visible: enabledConnections.wirelessEnabled visible: enabledConnections.wirelessEnabled

@ -97,9 +97,11 @@ ItemPage {
visible: wiredView.visible && enabledConnections.wirelessHwEnabled visible: wiredView.visible && enabledConnections.wirelessHwEnabled
} }
WifiView { RoundedItem {
Layout.fillWidth: true WifiView {
visible: enabledConnections.wirelessHwEnabled Layout.fillWidth: true
visible: enabledConnections.wirelessHwEnabled
}
} }
} }
} }

@ -0,0 +1,24 @@
import QtQuick 2.12
import QtQuick.Layouts 1.12
import FishUI 1.0 as FishUI
Rectangle {
Layout.fillWidth: true
default property alias content : _mainLayout.data
color: FishUI.Theme.darkMode ? "#363636" : "#FFFFFF"
radius: FishUI.Theme.mediumRadius
implicitHeight: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 2
ColumnLayout {
id: _mainLayout
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing * 1.5
anchors.rightMargin: FishUI.Units.largeSpacing * 1.5
anchors.topMargin: FishUI.Units.largeSpacing
anchors.bottomMargin: FishUI.Units.largeSpacing
}
}

@ -15,7 +15,7 @@ Item {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: FishUI.Theme.secondBackgroundColor color: FishUI.Theme.backgroundColor
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {

@ -16,6 +16,9 @@ FishUI.Window {
minimumHeight: 600 minimumHeight: 600
headerBarHeight: 50 headerBarHeight: 50
backgroundColor: FishUI.Theme.darkMode ? Qt.rgba(38 / 255, 38 / 255, 38 / 255, 255)
: Qt.rgba(237 / 255, 237 / 255, 242 / 255, 255)
headerBar: Item { headerBar: Item {
Rectangle { Rectangle {
id: leftArea id: leftArea
@ -23,7 +26,7 @@ FishUI.Window {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
implicitWidth: sideBar.width implicitWidth: sideBar.width
color: FishUI.Theme.secondBackgroundColor color: FishUI.Theme.backgroundColor
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {

@ -86,5 +86,6 @@
<file>qml/NetworkPage/WifiItem.qml</file> <file>qml/NetworkPage/WifiItem.qml</file>
<file>qml/NetworkPage/WirelessDetailsDialog.qml</file> <file>qml/NetworkPage/WirelessDetailsDialog.qml</file>
<file>qml/NetworkPage/WiredItem.qml</file> <file>qml/NetworkPage/WiredItem.qml</file>
<file>qml/RoundedItem.qml</file>
</qresource> </qresource>
</RCC> </RCC>

Loading…
Cancel
Save