mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
Initial commit
remove syncthing folder bar/popops: fix menu window anims and positioning bar/popops: change anims a little and add dropshadow Update README.md widgets/coloredicon: move to colorization, looks worse but..., yea bar/popops: make popup window dissapear on menu close README: add todo list, and brief desc Update README.md Update README.md Update README.md bar/systray: issue recreate on interact bar/systray: hide popup on interact bar/systray: add arrow for entries with children bar/battery: start of battery widget wallpaper/matugen: add foot template extra sizing conditions for sys tray bar/systray: add some more margin to text update settings schema bar/workspaces: filter by monitor, switch to scriptmodel settings: fix settings lol bar/systray: fix right item feat: screenshot tool clipboard one day... feat: init lockscreen mpris: add ipc handler for multimedia keys mpris stuff save progress put shell in subdir, and add nix package move readme back woops bar/volume: make tool bar smaller greeter: init greeter greeter: fixed resource links readme: update checklist progress maybe, maybe not fix: fixed screenshot tool not working fix: bar layout issues progress save progress update track styled popup still broken but getting there still broken but getting there fix: gitignore qmlls.ini fix: remove qmlls.ini progress save new popup system new popup system new popup system more work on popups fix: mask issues on popups update readme
This commit is contained in:
commit
9e44812e93
102 changed files with 4592 additions and 0 deletions
96
shell/bar/systray/SysTray.qml
Normal file
96
shell/bar/systray/SysTray.qml
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Services.SystemTray
|
||||
import "../../widgets"
|
||||
import ".."
|
||||
|
||||
// TODO:
|
||||
// 1. Get rid of leftItem/rightItem properties on menu
|
||||
// 2. Load menu properly, right now its pretty buggy
|
||||
// 3. Fix bug that causes close on update (nm-applet wifi networks updating)
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
spacing: 5
|
||||
visible: SystemTray.items.values.length > 0
|
||||
|
||||
required property var bar
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
model: SystemTray.items
|
||||
|
||||
delegate: StyledMouseArea {
|
||||
id: button
|
||||
Layout.preferredWidth: parent.height
|
||||
Layout.fillHeight: true
|
||||
|
||||
required property SystemTrayItem modelData
|
||||
property bool showMenu: false
|
||||
|
||||
onClicked: {
|
||||
menuOpener.menu = modelData.menu;
|
||||
showMenu = !showMenu;
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: trayIcon
|
||||
anchors.fill: parent
|
||||
source: {
|
||||
// console.log(trayField.modelData.id);
|
||||
switch (button.modelData.id) {
|
||||
case "obs":
|
||||
return "image://icon/obs-tray";
|
||||
default:
|
||||
return button.modelData.icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QsMenuOpener {
|
||||
id: menuOpener
|
||||
}
|
||||
|
||||
property PopupItem menu: PopupItem {
|
||||
id: menu
|
||||
owner: button
|
||||
popup: root.bar.popup
|
||||
show: button.showMenu
|
||||
onClosed: button.showMenu = false
|
||||
|
||||
implicitWidth: content.implicitWidth + (2 * 8)
|
||||
implicitHeight: content.implicitHeight + (2 * 8)
|
||||
|
||||
property var leftItem: false
|
||||
property var rightItem: false
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
spacing: 2
|
||||
anchors.centerIn: parent
|
||||
|
||||
Repeater {
|
||||
model: menuOpener.children
|
||||
|
||||
delegate: TrayMenuItem {
|
||||
id: sysTrayContent
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
rootMenu: menu
|
||||
|
||||
onInteracted: {
|
||||
button.showMenu = false;
|
||||
menuOpener.menu = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
177
shell/bar/systray/TrayMenuEntry.qml
Normal file
177
shell/bar/systray/TrayMenuEntry.qml
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import "../../widgets" as Widgets
|
||||
import "../.."
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
required property QsMenuEntry menuData
|
||||
required property var rootMenu
|
||||
signal interacted
|
||||
|
||||
Component.onCompleted: {
|
||||
if (menuData?.buttonType !== QsMenuButtonType.None || menuData?.icon != "") {
|
||||
rootMenu.leftItem = true;
|
||||
}
|
||||
|
||||
if (menuData?.hasChildren) {
|
||||
rootMenu.rightItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
WrapperRectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 25
|
||||
radius: 4
|
||||
color: {
|
||||
if (!root.menuData?.enabled)
|
||||
return "transparent";
|
||||
|
||||
if (entryArea.containsMouse) {
|
||||
return ShellSettings.colors.active_translucent;
|
||||
}
|
||||
|
||||
return "transparent";
|
||||
}
|
||||
|
||||
WrapperMouseArea {
|
||||
id: entryArea
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (!root.menuData?.enabled)
|
||||
return;
|
||||
|
||||
if (root.menuData?.hasChildren) {
|
||||
subTrayMenu.visible = !subTrayMenu.visible;
|
||||
return;
|
||||
}
|
||||
|
||||
root.menuData?.triggered();
|
||||
root.interacted();
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: menuEntry
|
||||
spacing: 5
|
||||
Layout.fillWidth: true
|
||||
|
||||
Item {
|
||||
visible: root.rootMenu.leftItem
|
||||
Layout.preferredWidth: 20
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.leftMargin: 5
|
||||
|
||||
RadioButton {
|
||||
id: radioButton
|
||||
visible: (root.menuData?.buttonType === QsMenuButtonType.RadioButton) ?? false
|
||||
checked: (root.menuData?.checkState) ?? false
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: checkBox
|
||||
visible: (root.menuData?.buttonType === QsMenuButtonType.CheckBox) ?? false
|
||||
checked: (root.menuData?.checkState) ?? false
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: entryImage
|
||||
visible: (root.menuData?.buttonType === QsMenuButtonType.None && root.menuData?.icon !== "") ?? false
|
||||
source: (root.menuData?.icon) ?? ""
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: text
|
||||
text: root.menuData?.text ?? ""
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: {
|
||||
let color = Qt.color(ShellSettings.colors.active);
|
||||
|
||||
if (!root.menuData?.enabled)
|
||||
return color.darker(2);
|
||||
|
||||
// if (entryArea.containsMouse)
|
||||
// return Qt.color(ShellSettings.colors["inverse_primary"]);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Item {
|
||||
visible: root.rootMenu.rightItem
|
||||
Layout.preferredHeight: 20
|
||||
Layout.preferredWidth: 20
|
||||
Layout.rightMargin: 5
|
||||
|
||||
Widgets.IconButton {
|
||||
id: arrowButton
|
||||
visible: root.menuData?.hasChildren ?? false
|
||||
activeRectangle: false
|
||||
source: "root:resources/general/right-arrow.svg"
|
||||
rotation: subTrayMenu.visible ? 90 : 0
|
||||
anchors.fill: parent
|
||||
|
||||
Behavior on rotation {
|
||||
NumberAnimation {
|
||||
duration: 150
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
root.expanded = !root.expanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WrapperRectangle {
|
||||
id: subTrayMenu
|
||||
color: ShellSettings.colors.surface_container_translucent
|
||||
radius: 8
|
||||
visible: false
|
||||
|
||||
border {
|
||||
width: 1
|
||||
color: ShellSettings.colors.active_translucent
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
QsMenuOpener {
|
||||
id: menuOpener
|
||||
menu: root.menuData
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: subTrayContainer
|
||||
spacing: 2
|
||||
Layout.fillWidth: true
|
||||
|
||||
Repeater {
|
||||
model: menuOpener.children
|
||||
|
||||
delegate: BoundComponent {
|
||||
id: subMenuEntry
|
||||
source: "TrayMenuItem.qml"
|
||||
Layout.fillWidth: true
|
||||
required property var modelData
|
||||
property var rootMenu: root.rootMenu
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
30
shell/bar/systray/TrayMenuItem.qml
Normal file
30
shell/bar/systray/TrayMenuItem.qml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
required property QsMenuEntry modelData
|
||||
required property var rootMenu
|
||||
property var leftItem
|
||||
signal interacted
|
||||
|
||||
Rectangle {
|
||||
visible: (root.modelData?.isSeparator ?? false)
|
||||
color: ShellSettings.colors.inactive_translucent
|
||||
// opacity: 0.1
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 2
|
||||
Layout.leftMargin: 8
|
||||
Layout.rightMargin: 8
|
||||
}
|
||||
|
||||
TrayMenuEntry {
|
||||
visible: !root.modelData?.isSeparator
|
||||
rootMenu: root.rootMenu
|
||||
menuData: root.modelData
|
||||
Layout.fillWidth: true
|
||||
onInteracted: root.interacted()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue