mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
progress update
This commit is contained in:
parent
41ccd5c460
commit
e82ef6e0c1
7 changed files with 175 additions and 128 deletions
|
|
@ -10,7 +10,7 @@ import ".."
|
|||
|
||||
PanelWindow {
|
||||
id: root
|
||||
color: ShellSettings.colors["surface"]
|
||||
color: "transparent"
|
||||
implicitHeight: ShellSettings.sizing.barHeight
|
||||
property alias popup: popupWindow
|
||||
|
||||
|
|
@ -20,6 +20,12 @@ PanelWindow {
|
|||
right: true
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: ShellSettings.colors.surface
|
||||
opacity: 0.15
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
// Popup window for all popups
|
||||
Popup.MenuWindow {
|
||||
id: popupWindow
|
||||
|
|
@ -37,38 +43,32 @@ PanelWindow {
|
|||
|
||||
// Left side of bar
|
||||
RowLayout {
|
||||
spacing: 5
|
||||
spacing: 15
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
HyprWorkspaces {
|
||||
screen: root.screen
|
||||
Layout.fillHeight: true
|
||||
Layout.leftMargin: 4
|
||||
}
|
||||
// HyprWorkspaces {
|
||||
// screen: root.screen
|
||||
// Layout.fillHeight: true
|
||||
// }
|
||||
|
||||
Widgets.Separator {
|
||||
visible: activeWindow.visible
|
||||
Layout.leftMargin: 5
|
||||
Layout.rightMargin: 5
|
||||
}
|
||||
|
||||
ActiveWindow {
|
||||
id: activeWindow
|
||||
Layout.preferredWidth: 400
|
||||
}
|
||||
// ActiveWindow {
|
||||
// id: activeWindow
|
||||
// Layout.preferredWidth: 400
|
||||
// }
|
||||
}
|
||||
|
||||
// Right side of bar
|
||||
RowLayout {
|
||||
spacing: 5
|
||||
spacing: 10
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
SysTray.SysTray {
|
||||
id: sysTray
|
||||
popup: root.popup
|
||||
// popup: root.popup
|
||||
bar: root
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
|
|
@ -81,20 +81,20 @@ PanelWindow {
|
|||
// Layout.bottomMargin: 2
|
||||
// }
|
||||
|
||||
BatteryIndicator {
|
||||
id: batteryIndicator
|
||||
popup: root.popup
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
// BatteryIndicator {
|
||||
// id: batteryIndicator
|
||||
// popup: root.popup
|
||||
// Layout.fillHeight: true
|
||||
// }
|
||||
|
||||
Widgets.Separator {
|
||||
Layout.leftMargin: 5
|
||||
Layout.rightMargin: 5
|
||||
}
|
||||
// Widgets.Separator {
|
||||
// Layout.leftMargin: 5
|
||||
// Layout.rightMargin: 5
|
||||
// }
|
||||
|
||||
Clock {
|
||||
id: clock
|
||||
color: ShellSettings.colors["inverse_surface"]
|
||||
color: ShellSettings.colors["active"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,9 @@ PopupWindow {
|
|||
let itemPos = item.mapToItem(root.bar.contentItem, 0, root.bar.height, item.width, 0).x;
|
||||
position(itemPos);
|
||||
|
||||
popupContainer.opacity = 0;
|
||||
popupContent.opacity = 0;
|
||||
// popupContainer.opacity = 0;
|
||||
// popupContent.opacity = 0;
|
||||
popupContainer.visible = false;
|
||||
}
|
||||
|
||||
function position(itemPos) {
|
||||
|
|
@ -66,15 +67,17 @@ PopupWindow {
|
|||
isOpen = true;
|
||||
root.visible = true; // set and leave open
|
||||
root.content.visible = true;
|
||||
popupContainer.opacity = 1;
|
||||
popupContent.opacity = 1;
|
||||
// popupContainer.opacity = 1;
|
||||
// popupContent.opacity = 1;
|
||||
popupContainer.visible = true;
|
||||
}
|
||||
|
||||
function hide() {
|
||||
grab.active = false;
|
||||
isOpen = false;
|
||||
popupContainer.opacity = 0;
|
||||
popupContent.opacity = 0;
|
||||
// popupContainer.opacity = 0;
|
||||
// popupContent.opacity = 0;
|
||||
popupContainer.visible = false;
|
||||
|
||||
root.item = undefined;
|
||||
root.content = undefined;
|
||||
|
|
@ -89,24 +92,33 @@ PopupWindow {
|
|||
}
|
||||
}
|
||||
|
||||
RectangularShadow {
|
||||
radius: popupContainer.radius
|
||||
// RectangularShadow {
|
||||
// radius: popupContainer.radius
|
||||
// anchors.fill: popupContainer
|
||||
// opacity: popupContainer.opacity
|
||||
// visible: popupContainer.visible
|
||||
// blur: 10
|
||||
// spread: 2
|
||||
// }
|
||||
|
||||
Rectangle {
|
||||
color: ShellSettings.colors.surface
|
||||
// opacity: ShellSettings.settings.opacity
|
||||
opacity: 0.15
|
||||
radius: 12
|
||||
anchors.fill: popupContainer
|
||||
opacity: popupContainer.opacity
|
||||
visible: popupContainer.visible
|
||||
blur: 10
|
||||
spread: 2
|
||||
border.color: ShellSettings.colors.active
|
||||
}
|
||||
|
||||
WrapperRectangle {
|
||||
WrapperItem {
|
||||
id: popupContainer
|
||||
|
||||
color: ShellSettings.colors["surface"]
|
||||
radius: 12
|
||||
// color: ShellSettings.colors.surface
|
||||
// radius: 12
|
||||
margin: 8
|
||||
clip: true
|
||||
opacity: 0
|
||||
visible: opacity > 0
|
||||
// opacity: 0.5
|
||||
// visible: opacity > 0
|
||||
x: root.bar.width
|
||||
|
||||
// spooky, likely to cause problems lol
|
||||
|
|
@ -132,7 +144,7 @@ PopupWindow {
|
|||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.Linear
|
||||
easing.type: Easing.InOutQuad
|
||||
from: 0
|
||||
to: 1
|
||||
}
|
||||
|
|
@ -158,25 +170,25 @@ PopupWindow {
|
|||
}
|
||||
}
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.Linear
|
||||
}
|
||||
}
|
||||
// Behavior on opacity {
|
||||
// NumberAnimation {
|
||||
// duration: 200
|
||||
// easing.type: Easing.Linear
|
||||
// }
|
||||
// }
|
||||
|
||||
Behavior on width {
|
||||
enabled: root.isOpen
|
||||
SmoothedAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.Linear
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on height {
|
||||
SmoothedAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.Linear
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +196,7 @@ PopupWindow {
|
|||
enabled: root.isOpen
|
||||
SmoothedAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.OutQuad
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ RowLayout {
|
|||
spacing: 5
|
||||
visible: SystemTray.items.values.length > 0
|
||||
|
||||
required property var popup
|
||||
// required property var popup
|
||||
required property var bar
|
||||
|
||||
Repeater {
|
||||
model: SystemTray.items
|
||||
|
|
@ -29,23 +30,26 @@ RowLayout {
|
|||
onClicked: {
|
||||
menuOpener.menu = trayField.modelData.menu;
|
||||
|
||||
if (root.popup.content == trayMenu) {
|
||||
root.popup.hide();
|
||||
if (trayMenu.visible) {
|
||||
trayMenu.visible = false;
|
||||
// root.popup.hide();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
root.popup.set(this, trayMenu);
|
||||
root.popup.show();
|
||||
trayMenu.visible = true;
|
||||
|
||||
// root.popup.set(this, trayMenu);
|
||||
// root.popup.show();
|
||||
}
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 2
|
||||
// margins: 2
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: trayIcon
|
||||
anchors.fill: parent
|
||||
source: {
|
||||
// console.log(trayField.modelData.id);
|
||||
switch (trayField.modelData.id) {
|
||||
|
|
@ -55,6 +59,11 @@ RowLayout {
|
|||
return trayField.modelData.icon;
|
||||
}
|
||||
}
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,13 +71,19 @@ RowLayout {
|
|||
id: menuOpener
|
||||
}
|
||||
|
||||
WrapperItem {
|
||||
Widgets.StyledPopup {
|
||||
id: trayMenu
|
||||
visible: false
|
||||
// visible: false
|
||||
|
||||
property var leftItem: false
|
||||
property var rightItem: false
|
||||
|
||||
anchor {
|
||||
window: root.bar
|
||||
item: trayButton
|
||||
margins.top: root.bar.height + 5
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: menuContainer
|
||||
spacing: 2
|
||||
|
|
|
|||
|
|
@ -25,13 +25,15 @@ ColumnLayout {
|
|||
WrapperRectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 25
|
||||
radius: 6
|
||||
radius: 4
|
||||
color: {
|
||||
if (!root.menuData?.enabled)
|
||||
return "transparent";
|
||||
|
||||
if (entryArea.containsMouse)
|
||||
return ShellSettings.colors["primary"];
|
||||
if (entryArea.containsMouse) {
|
||||
let base = ShellSettings.colors.active;
|
||||
return Qt.rgba(base.r, base.g, base.b, 0.15);
|
||||
}
|
||||
|
||||
return "transparent";
|
||||
}
|
||||
|
|
@ -92,13 +94,13 @@ ColumnLayout {
|
|||
text: root.menuData?.text ?? ""
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: {
|
||||
let color = Qt.color(ShellSettings.colors["inverse_surface"]);
|
||||
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"]);
|
||||
// if (entryArea.containsMouse)
|
||||
// return Qt.color(ShellSettings.colors["inverse_primary"]);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
|
@ -139,7 +141,7 @@ ColumnLayout {
|
|||
|
||||
WrapperRectangle {
|
||||
id: subTrayMenu
|
||||
color: ShellSettings.colors["surface_container"]
|
||||
color: ShellSettings.colors.surface_container
|
||||
radius: 8
|
||||
visible: false
|
||||
Layout.fillWidth: true
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ ColumnLayout {
|
|||
|
||||
Rectangle {
|
||||
visible: (root.modelData?.isSeparator ?? false)
|
||||
color: ShellSettings.colors["surface_container_high"]
|
||||
color: ShellSettings.colors.inactive
|
||||
opacity: 0.1
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 2
|
||||
Layout.leftMargin: 8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue