mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
sidebar: add scroll to bottom button
This commit is contained in:
@@ -152,6 +152,7 @@ Singleton {
|
||||
property color colPrimaryContainerActive: ColorUtils.mix(colors.colPrimaryContainer, colors.colOnPrimaryContainer, 0.8)
|
||||
property color colOnPrimaryContainer: m3colors.m3onPrimaryContainer
|
||||
property color colSecondary: m3colors.m3secondary
|
||||
property color colOnSecondary: m3colors.m3onSecondary
|
||||
property color colSecondaryHover: ColorUtils.mix(m3colors.m3secondary, colLayer1Hover, 0.85)
|
||||
property color colSecondaryActive: ColorUtils.mix(m3colors.m3secondary, colLayer1Active, 0.4)
|
||||
property color colSecondaryContainer: m3colors.m3secondaryContainer
|
||||
|
||||
@@ -175,7 +175,7 @@ Singleton {
|
||||
property bool enableWorkspace: true
|
||||
property real workspaceZoom: 1.07 // Relative to your screen, not wallpaper size
|
||||
property bool enableSidebar: true
|
||||
property real clockFactor: 1.13
|
||||
property real clockFactor: 1.2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -321,12 +321,14 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
|
||||
}
|
||||
|
||||
ScrollEdgeFade {
|
||||
z: 1
|
||||
target: messageListView
|
||||
vertical: true
|
||||
}
|
||||
|
||||
StyledListView { // Message list
|
||||
id: messageListView
|
||||
z: 0
|
||||
anchors.fill: parent
|
||||
spacing: 10
|
||||
popin: false
|
||||
@@ -362,11 +364,17 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
|
||||
}
|
||||
|
||||
PagePlaceholder {
|
||||
z: 2
|
||||
shown: Ai.messageIDs.length === 0
|
||||
icon: "neurology"
|
||||
title: Translation.tr("Large language models")
|
||||
description: Translation.tr("Type /key to get started with online models\nCtrl+O to expand the sidebar\nCtrl+P to detach sidebar into a window")
|
||||
}
|
||||
|
||||
ScrollToBottomButton {
|
||||
z: 3
|
||||
target: messageListView
|
||||
}
|
||||
}
|
||||
|
||||
DescriptionBox {
|
||||
|
||||
@@ -152,12 +152,14 @@ Item {
|
||||
}
|
||||
|
||||
ScrollEdgeFade {
|
||||
z: 1
|
||||
target: booruResponseListView
|
||||
vertical: true
|
||||
}
|
||||
|
||||
StyledListView { // Booru responses
|
||||
id: booruResponseListView
|
||||
z: 0
|
||||
anchors.fill: parent
|
||||
spacing: 10
|
||||
|
||||
@@ -187,13 +189,20 @@ Item {
|
||||
|
||||
PagePlaceholder {
|
||||
id: placeholderItem
|
||||
z: 2
|
||||
shown: root.responses.length === 0
|
||||
icon: "bookmark_heart"
|
||||
title: Translation.tr("Anime boorus")
|
||||
description: ""
|
||||
}
|
||||
|
||||
ScrollToBottomButton {
|
||||
z: 3
|
||||
target: booruResponseListView
|
||||
}
|
||||
|
||||
Item { // Queries awaiting response
|
||||
z: 4
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import qs.services
|
||||
import qs.modules.common
|
||||
import qs.modules.common.widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
RippleButton {
|
||||
id: root
|
||||
required property ListView target
|
||||
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
bottomMargin: 10
|
||||
}
|
||||
|
||||
opacity: !target.atYEnd ? 1 : 0
|
||||
scale: !target.atYEnd ? 1 : 0.7
|
||||
visible: opacity > 0
|
||||
Behavior on opacity {
|
||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||
}
|
||||
Behavior on scale {
|
||||
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
|
||||
}
|
||||
|
||||
implicitWidth: contentItem.implicitWidth + 8 * 2
|
||||
implicitHeight: contentItem.implicitHeight + 4 * 2
|
||||
|
||||
colBackground: Appearance.colors.colSecondary
|
||||
colBackgroundHover: Appearance.colors.colSecondaryHover
|
||||
colRipple: Appearance.colors.colSecondaryActive
|
||||
buttonRadius: Appearance.rounding.verysmall
|
||||
|
||||
downAction: () => {
|
||||
target.positionViewAtEnd()
|
||||
}
|
||||
|
||||
contentItem: Row {
|
||||
id: contentItem
|
||||
spacing: 4
|
||||
MaterialSymbol {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "arrow_downward"
|
||||
font.pixelSize: Appearance.font.pixelSize.larger
|
||||
color: Appearance.colors.colOnSecondary
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: Translation.tr("Scroll to Bottom")
|
||||
font.pixelSize: Appearance.font.pixelSize.smallie
|
||||
color: Appearance.colors.colOnSecondary
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.modules.common
|
||||
import qs.modules.common.functions
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
Reference in New Issue
Block a user