mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Renamed all services to xxxService. Moved a couple things in Commons
This commit is contained in:
@@ -4,6 +4,7 @@ import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Modules.Settings.Tabs as Tabs
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
@@ -13,7 +14,7 @@ NLoader {
|
||||
// Tabs enumeration, order is NOT relevant
|
||||
enum Tab {
|
||||
About,
|
||||
Audio,
|
||||
AudioService,
|
||||
Bar,
|
||||
ColorScheme,
|
||||
Display,
|
||||
@@ -119,8 +120,8 @@ NLoader {
|
||||
"icon": "web_asset",
|
||||
"source": barTab
|
||||
}, {
|
||||
"id": SettingsPanel.Tab.Audio,
|
||||
"label": "Audio",
|
||||
"id": SettingsPanel.Tab.AudioService,
|
||||
"label": "AudioService",
|
||||
"icon": "volume_up",
|
||||
"source": audioTab
|
||||
}, {
|
||||
|
||||
@@ -4,15 +4,16 @@ import QtQuick.Effects
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
property string latestVersion: GitHub.latestVersion
|
||||
property string latestVersion: GitHubService.latestVersion
|
||||
property string currentVersion: "Unknown" // Fallback version
|
||||
property var contributors: GitHub.contributors
|
||||
property var contributors: GitHubService.contributors
|
||||
|
||||
spacing: 0
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -5,18 +5,19 @@ import Quickshell.Services.Pipewire
|
||||
|
||||
import qs.Modules.Settings
|
||||
import qs.Widgets
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
property real localVolume: Audio.volume
|
||||
property real localVolume: AudioService.volume
|
||||
|
||||
// Connection used to open the pill when volume changes
|
||||
Connections {
|
||||
target: Audio.sink?.audio ? Audio.sink?.audio : null
|
||||
target: AudioService.sink?.audio ? AudioService.sink?.audio : null
|
||||
function onVolumeChanged() {
|
||||
localVolume = Audio.volume
|
||||
localVolume = AudioService.volume
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +47,7 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
|
||||
NText {
|
||||
text: "Audio"
|
||||
text: "AudioService"
|
||||
font.pointSize: Style.fontSizeXL * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.mOnSurface
|
||||
@@ -90,8 +91,8 @@ ColumnLayout {
|
||||
running: true
|
||||
repeat: true
|
||||
onTriggered: {
|
||||
if (Math.abs(localVolume - Audio.volume) >= 0.01) {
|
||||
Audio.setVolume(localVolume)
|
||||
if (Math.abs(localVolume - AudioService.volume) >= 0.01) {
|
||||
AudioService.setVolume(localVolume)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,7 +109,7 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
NText {
|
||||
text: Math.floor(Audio.volume * 100) + "%"
|
||||
text: Math.floor(AudioService.volume * 100) + "%"
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
color: Colors.mOnSurface
|
||||
}
|
||||
@@ -122,12 +123,12 @@ ColumnLayout {
|
||||
Layout.topMargin: Style.marginMedium * scaling
|
||||
|
||||
NToggle {
|
||||
label: "Mute Audio"
|
||||
label: "Mute AudioService"
|
||||
description: "Mute or unmute the default audio output"
|
||||
value: Audio.muted
|
||||
value: AudioService.muted
|
||||
onToggled: function (newValue) {
|
||||
if (Audio.sink && Audio.sink.audio) {
|
||||
Audio.sink.audio.muted = newValue
|
||||
if (AudioService.sink && AudioService.sink.audio) {
|
||||
AudioService.sink.audio.muted = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,13 +141,13 @@ ColumnLayout {
|
||||
Layout.bottomMargin: Style.marginLarge * scaling
|
||||
}
|
||||
|
||||
// Audio Devices
|
||||
// AudioService Devices
|
||||
ColumnLayout {
|
||||
spacing: Style.marginLarge * scaling
|
||||
Layout.fillWidth: true
|
||||
|
||||
NText {
|
||||
text: "Audio Devices"
|
||||
text: "AudioService Devices"
|
||||
font.pointSize: Style.fontSizeXL * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.mOnSurface
|
||||
@@ -180,12 +181,12 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: Audio.sinks
|
||||
model: AudioService.sinks
|
||||
NRadioButton {
|
||||
required property PwNode modelData
|
||||
ButtonGroup.group: sinks
|
||||
checked: Audio.sink?.id === modelData.id
|
||||
onClicked: Audio.setAudioSink(modelData)
|
||||
checked: AudioService.sink?.id === modelData.id
|
||||
onClicked: AudioService.setAudioSink(modelData)
|
||||
text: modelData.description
|
||||
}
|
||||
}
|
||||
@@ -219,12 +220,12 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: Audio.sources
|
||||
model: AudioService.sources
|
||||
NRadioButton {
|
||||
required property PwNode modelData
|
||||
ButtonGroup.group: sources
|
||||
checked: Audio.source?.id === modelData.id
|
||||
onClicked: Audio.setAudioSource(modelData)
|
||||
checked: AudioService.source?.id === modelData.id
|
||||
onClicked: AudioService.setAudioSource(modelData)
|
||||
text: modelData.description
|
||||
}
|
||||
}
|
||||
@@ -238,20 +239,20 @@ ColumnLayout {
|
||||
Layout.bottomMargin: Style.marginMedium * scaling
|
||||
}
|
||||
|
||||
// Audio Visualizer Category
|
||||
// AudioService Visualizer Category
|
||||
ColumnLayout {
|
||||
spacing: Style.marginSmall * scaling
|
||||
Layout.fillWidth: true
|
||||
|
||||
NText {
|
||||
text: "Audio Visualizer"
|
||||
text: "AudioService Visualizer"
|
||||
font.pointSize: Style.fontSizeXL * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.mOnSurface
|
||||
Layout.bottomMargin: Style.marginSmall * scaling
|
||||
}
|
||||
|
||||
// Audio Visualizer section
|
||||
// AudioService Visualizer section
|
||||
NComboBox {
|
||||
id: audioVisualizerCombo
|
||||
label: "Visualization Type"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import Quickshell.Io
|
||||
@@ -66,7 +67,7 @@ ColumnLayout {
|
||||
// When the list of available schemes changes, clear the cache.
|
||||
// The Repeater below will automatically re-create the FileViews.
|
||||
Connections {
|
||||
target: ColorSchemes
|
||||
target: ColorSchemesService
|
||||
function onSchemesChanged() {
|
||||
schemeColorsCache = {}
|
||||
}
|
||||
@@ -78,7 +79,7 @@ ColumnLayout {
|
||||
id: fileLoaders
|
||||
|
||||
Repeater {
|
||||
model: ColorSchemes.schemes
|
||||
model: ColorSchemesService.schemes
|
||||
|
||||
// The delegate is a Component, which correctly wraps the non-visual FileView
|
||||
delegate: Item {
|
||||
@@ -132,7 +133,7 @@ ColumnLayout {
|
||||
onToggled: function (newValue) {
|
||||
Settings.data.colorSchemes.useWallpaperColors = newValue
|
||||
if (Settings.data.colorSchemes.useWallpaperColors) {
|
||||
ColorSchemes.changedWallpaper()
|
||||
ColorSchemesService.changedWallpaper()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,7 +178,7 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
|
||||
Repeater {
|
||||
model: ColorSchemes.schemes
|
||||
model: ColorSchemesService.schemes
|
||||
|
||||
Rectangle {
|
||||
id: schemeCard
|
||||
@@ -197,9 +198,10 @@ ColumnLayout {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
// Disable useWallpaperColors when picking a predefined color scheme
|
||||
// TBC: broken uncheck useWallpaperColors
|
||||
Settings.data.colorSchemes.useWallpaperColors = false
|
||||
Settings.data.colorSchemes.predefinedScheme = schemePath
|
||||
ColorSchemes.applyScheme(schemePath)
|
||||
ColorSchemesService.applyScheme(schemePath)
|
||||
}
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
@@ -2,6 +2,7 @@ import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Bluetooth
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
@@ -206,23 +207,23 @@ ColumnLayout {
|
||||
Layout.bottomMargin: Style.marginLarge * scaling
|
||||
}
|
||||
|
||||
// Audio Settings
|
||||
// AudioService Settings
|
||||
ColumnLayout {
|
||||
spacing: Style.marginLarge * scaling
|
||||
Layout.fillWidth: true
|
||||
|
||||
NText {
|
||||
text: "Audio Settings"
|
||||
text: "AudioService Settings"
|
||||
font.pointSize: Style.fontSizeXL * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.mOnSurface
|
||||
Layout.bottomMargin: Style.marginSmall * scaling
|
||||
}
|
||||
|
||||
// Audio Source
|
||||
// AudioService Source
|
||||
NComboBox {
|
||||
label: "Audio Source"
|
||||
description: "Audio source to capture during recording"
|
||||
label: "AudioService Source"
|
||||
description: "AudioService source to capture during recording"
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
key: "default_output"
|
||||
@@ -243,9 +244,9 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
// Audio Codec
|
||||
// AudioService Codec
|
||||
NComboBox {
|
||||
label: "Audio Codec"
|
||||
label: "AudioService Codec"
|
||||
description: "Opus is recommended for best performance and smallest audio size"
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.folderlistmodel
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
@@ -48,7 +49,7 @@ Item {
|
||||
id: currentWallpaperImage
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginSmall * scaling
|
||||
imagePath: Wallpapers.currentWallpaper
|
||||
imagePath: WallpapersService.currentWallpaper
|
||||
fallbackIcon: "image"
|
||||
borderColor: Colors.mOutline
|
||||
borderWidth: Math.max(1, Style.borderThin * scaling)
|
||||
@@ -96,7 +97,7 @@ Item {
|
||||
icon: "refresh"
|
||||
tooltipText: "Refresh wallpaper list"
|
||||
onClicked: {
|
||||
Wallpapers.loadWallpapers()
|
||||
WallpapersService.loadWallpapers()
|
||||
}
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignRight
|
||||
}
|
||||
@@ -106,14 +107,14 @@ Item {
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: {
|
||||
return Math.ceil(Wallpapers.wallpaperList.length / wallpaperGridView.columns) * wallpaperGridView.cellHeight
|
||||
return Math.ceil(WallpapersService.wallpaperList.length / wallpaperGridView.columns) * wallpaperGridView.cellHeight
|
||||
}
|
||||
|
||||
GridView {
|
||||
id: wallpaperGridView
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
model: Wallpapers.wallpaperList
|
||||
model: WallpapersService.wallpaperList
|
||||
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
flickableDirection: Flickable.AutoFlickDirection
|
||||
@@ -134,7 +135,7 @@ Item {
|
||||
delegate: Rectangle {
|
||||
id: wallpaperItem
|
||||
property string wallpaperPath: modelData
|
||||
property bool isSelected: wallpaperPath === Wallpapers.currentWallpaper
|
||||
property bool isSelected: wallpaperPath === WallpapersService.currentWallpaper
|
||||
|
||||
width: wallpaperGridView.itemSize
|
||||
height: Math.floor(wallpaperGridView.itemSize * 0.67)
|
||||
@@ -195,7 +196,7 @@ Item {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
Wallpapers.changeWallpaper(wallpaperPath)
|
||||
WallpapersService.changeWallpaper(wallpaperPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,7 +209,7 @@ Item {
|
||||
radius: Style.radiusMedium * scaling
|
||||
border.color: Colors.mOutline
|
||||
border.width: Math.max(1, Style.borderThin * scaling)
|
||||
visible: Wallpapers.wallpaperList.length === 0 && !Wallpapers.scanning
|
||||
visible: WallpapersService.wallpaperList.length === 0 && !WallpapersService.scanning
|
||||
|
||||
ColumnLayout {
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user