move font picker to settings app
This commit is contained in:
parent
8b2e5e7520
commit
210d5fb4c6
@ -3,7 +3,6 @@ import Quickshell.Wayland
|
|||||||
import qs
|
import qs
|
||||||
import qs.settings
|
import qs.settings
|
||||||
import qs.reusables
|
import qs.reusables
|
||||||
import QtQuick.Dialogs
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: container
|
id: container
|
||||||
@ -26,20 +25,6 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: fontOpener
|
id: fontOpener
|
||||||
FontDialog {
|
|
||||||
id: fontPicker
|
|
||||||
title: "qs-fontpicker"
|
|
||||||
flags: FontDialog.NoButtons | FontDialog.MonospacedFonts
|
|
||||||
|
|
||||||
onAccepted: {
|
|
||||||
Settings.config.font = selectedFont.family;
|
|
||||||
Settings.config.fontSize = selectedFont.pointSize;
|
|
||||||
}
|
|
||||||
onSelectedFontChanged: {
|
|
||||||
Settings.config.font = selectedFont.family;
|
|
||||||
Settings.config.fontSize = selectedFont.pointSize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
import QtQuick
|
|
||||||
import qs
|
|
||||||
import qs.reusables
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
implicitWidth: 300
|
|
||||||
implicitHeight: 300
|
|
||||||
CustomText {
|
|
||||||
text: "I am the Appearance page"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
80
modules/widgets/settingsapp/Appearance.qml
Normal file
80
modules/widgets/settingsapp/Appearance.qml
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
import QtQuick
|
||||||
|
import qs
|
||||||
|
import qs.reusables
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import qs.settings
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Dialogs
|
||||||
|
|
||||||
|
ClippingWrapperRectangle {
|
||||||
|
id: root
|
||||||
|
FontDialog {
|
||||||
|
id: fontPicker
|
||||||
|
title: "qs-fontpicker"
|
||||||
|
flags: FontDialog.NoButtons | FontDialog.MonospacedFonts
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
|
Settings.config.font = selectedFont.family;
|
||||||
|
Settings.config.fontSize = selectedFont.pointSize;
|
||||||
|
}
|
||||||
|
onSelectedFontChanged: {
|
||||||
|
Settings.config.font = selectedFont.family;
|
||||||
|
Settings.config.fontSize = selectedFont.pointSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
anchors.centerIn: parent
|
||||||
|
clip: true
|
||||||
|
color: Colors.surfaceContainerLow
|
||||||
|
radius: 12
|
||||||
|
margin: 20
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: verticalLayout
|
||||||
|
Rectangle {
|
||||||
|
id: fontWrapper
|
||||||
|
radius: 14
|
||||||
|
color: Colors.surfaceContainerHigh
|
||||||
|
implicitHeight: fontLayout.implicitHeight + 10
|
||||||
|
implicitWidth: fontLayout.implicitWidth + 10
|
||||||
|
RowLayout {
|
||||||
|
id: fontLayout
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
clip: true
|
||||||
|
spacing: 10
|
||||||
|
CustomText {
|
||||||
|
id: fontText
|
||||||
|
font.bold: true
|
||||||
|
text: "current font: " + Settings.config.font
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
id: fontSelector
|
||||||
|
Layout.rightMargin: 5
|
||||||
|
implicitWidth: fontSelectorText.implicitWidth + 20
|
||||||
|
implicitHeight: 20
|
||||||
|
color: Colors.surfaceContainerHigh
|
||||||
|
border.width: 2
|
||||||
|
border.color: Colors.outline
|
||||||
|
radius: 12
|
||||||
|
CustomText {
|
||||||
|
id: fontSelectorText
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: "Pick Font"
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
id: fontPickerOpener
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.LeftButton
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: fontPicker.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
id: spring
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -35,13 +35,16 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: windowLayout
|
id: windowLayout
|
||||||
|
clip: true
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
ClippingWrapperRectangle {
|
ClippingWrapperRectangle {
|
||||||
id: pageWrapper
|
id: pageWrapper
|
||||||
Layout.margins: 20
|
Layout.margins: 20
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.preferredWidth: 200
|
Layout.preferredWidth: 200
|
||||||
|
Layout.rightMargin: 0
|
||||||
margin: 20
|
margin: 20
|
||||||
color: Colors.surfaceContainerLow
|
color: Colors.surfaceContainerLow
|
||||||
radius: 12
|
radius: 12
|
||||||
@ -54,7 +57,7 @@ FloatingWindow {
|
|||||||
id: pageDelegate
|
id: pageDelegate
|
||||||
Rectangle {
|
Rectangle {
|
||||||
radius: 24
|
radius: 24
|
||||||
color: ListView.isCurrentItem ? Colors.surfaceContainerHighest : "transparent"
|
color: ListView.isCurrentItem ? Colors.surfaceContainerHigh : "transparent"
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
implicitWidth: pageWrapper.width - 50
|
implicitWidth: pageWrapper.width - 50
|
||||||
required property var modelData
|
required property var modelData
|
||||||
@ -82,6 +85,7 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
Loader {
|
Loader {
|
||||||
id: contentLoader
|
id: contentLoader
|
||||||
|
Layout.leftMargin: 0
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.margins: 20
|
Layout.margins: 20
|
||||||
@ -8,7 +8,7 @@ ClippingWrapperRectangle {
|
|||||||
id: root
|
id: root
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
clip: true
|
clip: true
|
||||||
color: Colors.surfaceContainerHighest
|
color: Colors.surfaceContainerLow
|
||||||
radius: 12
|
radius: 12
|
||||||
margin: 20
|
margin: 20
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
@ -16,7 +16,7 @@ ClippingWrapperRectangle {
|
|||||||
spacing: 0
|
spacing: 0
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
CustomText {
|
CustomText {
|
||||||
|
topPadding: 10
|
||||||
text: "Welcome!"
|
text: "Welcome!"
|
||||||
font.pixelSize: 24
|
font.pixelSize: 24
|
||||||
font.bold: true
|
font.bold: true
|
||||||
@ -6,7 +6,7 @@ import qs.modules.bar
|
|||||||
import qs.modules.overlays
|
import qs.modules.overlays
|
||||||
import qs.modules.notifications
|
import qs.modules.notifications
|
||||||
import qs.modules.widgets.wallswitcher
|
import qs.modules.widgets.wallswitcher
|
||||||
import qs.modules.widgets.SettingsApp
|
import qs.modules.widgets.settingsapp
|
||||||
|
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
id: root
|
id: root
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user