Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SnoutBug authored Mar 7, 2022
1 parent 0f52c6b commit b159b9c
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 37 deletions.
71 changes: 48 additions & 23 deletions contents/ui/AppList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ ScrollView {
property bool hasListener: false
property bool isRight: true

property var scrollpositon: 0.0
property var scrollheight: 0.0

function updateModels() {
item.pinnedModel = [globalFavorites, rootModel.modelForRow(0), rootModel.modelForRow(1)]
item.allAppsModel = [rootModel.modelForRow(2)]
Expand All @@ -71,8 +74,18 @@ ScrollView {
currentStateIndex = plasmoid.configuration.defaultPage
}
}
onContentHeightChanged: {
ScrollBar.vertical.position = scrollpositon * scrollheight / scrollView.contentHeight
}
Column {
id: column
width: parent.width
onPositioningComplete: {
scrollView.contentHeight = height
if (height < backdrop.height) {
scrollView.contentHeight = backdrop.height + 1
}
}
Item { //Spacer
width: 1
height: 20 * PlasmaCore.Units.devicePixelRatio
Expand All @@ -85,7 +98,7 @@ ScrollView {
PlasmaComponents.Label {
x: parent.width + 10 * PlasmaCore.Units.devicePixelRatio
anchors.verticalCenter: parent.verticalCenter
text: "Favorite Apps"
text: i18n("Favorite Apps")
color: main.textColor
font.family: main.textFont
font.pixelSize: 12 * PlasmaCore.Units.devicePixelRatio
Expand All @@ -101,7 +114,6 @@ ScrollView {
width: 1
height: 10 * PlasmaCore.Units.devicePixelRatio
}

Flow { //Favorites
id: flow
x: 0
Expand All @@ -114,7 +126,6 @@ ScrollView {
}
}
}

Item { //Spacer
width: 1
height: 24 * PlasmaCore.Units.devicePixelRatio
Expand All @@ -127,72 +138,72 @@ ScrollView {
states: [
State {
name: "all";
PropertyChanges { target: sortingLabel; text: 'All'}
PropertyChanges { target: sortingLabel; text: i18n("All")}
PropertyChanges { target: sortingImage; source: 'icons/feather/file-text.svg'}
},
State {
name: "dev";
PropertyChanges { target: sortingLabel; text: 'Developement'}
PropertyChanges { target: sortingLabel; text: i18n("Developement")}
PropertyChanges { target: sortingImage; source: 'icons/feather/code.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(3)}
},
State {
name: "games";
PropertyChanges { target: sortingLabel; text: 'Games'}
PropertyChanges { target: sortingLabel; text: i18n("Games")}
PropertyChanges { target: sortingImage; source: 'icons/lucide/gamepad-2.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(4)}
},
State {
name: "graphics";
PropertyChanges { target: sortingLabel; text: 'Graphics'}
PropertyChanges { target: sortingLabel; text: i18n("Graphics")}
PropertyChanges { target: sortingImage; source: 'icons/feather/image.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(5)}
},
State {
name: "internet";
PropertyChanges { target: sortingLabel; text: 'Internet'}
PropertyChanges { target: sortingLabel; text: i18n("Internet")}
PropertyChanges { target: sortingImage; source: 'icons/feather/globe.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(6)}
},
State {
name: "multimedia";
PropertyChanges { target: sortingLabel; text: 'Multimedia'}
PropertyChanges { target: sortingLabel; text: i18n("Multimedia")}
PropertyChanges { target: sortingImage; source: 'icons/lucide/film.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(8)}
},
State {
name: "office";
PropertyChanges { target: sortingLabel; text: 'Office'}
PropertyChanges { target: sortingLabel; text: i18n("Office")}
PropertyChanges { target: sortingImage; source: 'icons/lucide/paperclip.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(9)}
},
State {
name: "science";
PropertyChanges { target: sortingLabel; text: 'Science & Math'}
PropertyChanges { target: sortingLabel; text: i18n("Science & Math")}
PropertyChanges { target: sortingImage; source: 'icons/lucide/flask-conical.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(10)}
},
State {
name: "settings";
PropertyChanges { target: sortingLabel; text: 'Settings'}
PropertyChanges { target: sortingLabel; text: i18n("Settings")}
PropertyChanges { target: sortingImage; source: 'icons/feather/settings.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(11)}
},
State {
name: "system";
PropertyChanges { target: sortingLabel; text: 'System'}
PropertyChanges { target: sortingLabel; text: i18n("System")}
PropertyChanges { target: sortingImage; source: 'icons/lucide/cpu.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(12)}
},
State {
name: "utilities";
PropertyChanges { target: sortingLabel; text: 'Utilities'}
PropertyChanges { target: sortingLabel; text: i18n("Utilities")}
PropertyChanges { target: sortingImage; source: 'icons/feather/tool.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(13)}
},
State {
name: "lost";
PropertyChanges { target: sortingLabel; text: 'Lost & Found'}
PropertyChanges { target: sortingLabel; text: i18n("Lost & Found")}
PropertyChanges { target: sortingImage; source: 'icons/feather/trash-2.svg'}
PropertyChanges { target: (currentStateIndex % 2 == 0 ? categoriesRepeater : categoriesRepeater2); model: rootModel.modelForRow(7)}
}
Expand All @@ -201,7 +212,7 @@ ScrollView {
id: sortingLabel
x: parent.width + 10 * PlasmaCore.Units.devicePixelRatio
anchors.verticalCenter: parent.verticalCenter
text: "All"
text: i18n("All")
color: main.textColor
font.family: main.textFont
font.pixelSize: 12 * PlasmaCore.Units.devicePixelRatio
Expand Down Expand Up @@ -245,12 +256,11 @@ ScrollView {
height: 10 * PlasmaCore.Units.devicePixelRatio
}

Grid { //All Apps // want to convert this to listview later to use verticallayoutdireciton
Grid {
id: allAppsGrid
x: - 10 * PlasmaCore.Units.devicePixelRatio
columns: 1
width: scrollView.width - 10 * PlasmaCore.Units.devicePixelRatio
//verticalLayoutDirection: main.isTop ? ListView.BottomToTop : ListView.TopToBottom
visible: opacity > 0
Repeater {
id: allAppsRepeater
Expand All @@ -266,12 +276,12 @@ ScrollView {
}
states: [
State {
name: "hidden"; when: (sortingLabel.text != 'All')
name: "hidden"; when: (sortingImage.state != 'all')
PropertyChanges { target: allAppsGrid; opacity: 0.0 }
PropertyChanges { target: allAppsGrid; x: (!isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0) }
},
State {
name: "shown"; when: (sortingLabel.text == 'All')
name: "shown"; when: (sortingImage.state == 'all')
PropertyChanges { target: allAppsGrid; opacity: 1.0 }
PropertyChanges { target: allAppsGrid; x: -10 }
}]
Expand All @@ -287,13 +297,16 @@ ScrollView {
NumberAnimation { properties: 'x'; from: (isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0); duration: 40; }
}
]
onStateChanged: {
if (state == 'hidden') {
scrollpositon = scrollView.ScrollBar.vertical.position
scrollheight = scrollView.contentHeight
}
}
}


Grid { //Categories
id: appCategories
columns: 1
//anchors.top: allAppsGrid.opacity != 1 ? allAppsGrid.top : NULL
width: scrollView.width - 10 * PlasmaCore.Units.devicePixelRatio
visible: opacity > 0
Repeater {
Expand Down Expand Up @@ -327,6 +340,12 @@ ScrollView {
NumberAnimation { properties: 'x'; from: (isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0); duration: 40; }
}
]
onStateChanged: {
if (state == 'hidden') {
scrollpositon = scrollView.ScrollBar.vertical.position
scrollheight = scrollView.contentHeight
}
}
}

Grid { //Categories
Expand Down Expand Up @@ -365,6 +384,12 @@ ScrollView {
NumberAnimation { properties: 'x'; from: (isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0);duration: 40; }
}
]
onStateChanged: {
if (state == 'hidden') {
scrollpositon = scrollView.ScrollBar.vertical.position
scrollheight = scrollView.contentHeight
}
}
}

Item { //Spacer
Expand Down
39 changes: 35 additions & 4 deletions contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.0

import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons
import org.kde.draganddrop 2.0 as DragDrop
Expand Down Expand Up @@ -50,6 +51,8 @@ Kirigami.FormLayout {
property alias cfg_customGreeting: customGreeting.text
property alias cfg_floating: floating.checked
property alias cfg_launcherPosition: launcherPosition.currentIndex
property alias cfg_offsetX: screenOffset.value
property alias cfg_offsetY: panelOffset.value

Button {
id: iconButton
Expand Down Expand Up @@ -173,7 +176,7 @@ Kirigami.FormLayout {
onPressed: colorDialog.visible ? colorDialog.close() : colorDialog.open()
ColorDialog {
id: colorDialog
title: "Please choose a color"
title: i18n("Please choose a color")
onAccepted: {
cfg_indicatorColor = colorDialog.color
}
Expand All @@ -196,7 +199,7 @@ Kirigami.FormLayout {
TextField {
id: customGreeting
Kirigami.FormData.label: i18n("Custom Greeting Text:")
placeholderText: "No custom greeting set"
placeholderText: i18n("No custom greeting set")
}
Item {
Kirigami.FormData.isSection: true
Expand All @@ -219,8 +222,36 @@ Kirigami.FormLayout {
}
}
CheckBox {
id: floating
text: i18n("Floating")
id: floating
text: i18n("Floating")
onCheckedChanged: {
screenOffset.visible = checked
panelOffset.visible = checked
}
}
Slider {
id: screenOffset
visible: plasmoid.configuration.floating
Kirigami.FormData.label: i18n("Offset Screen Edge (0 is Default):")
from: 0
value: 0
to: 100
stepSize: 1
PlasmaComponents.ToolTip {
text: screenOffset.value
}
}
Slider {
id: panelOffset
visible: plasmoid.configuration.floating
Kirigami.FormData.label: i18n("Offset Panel (0 is Default):")
from: 0
value: 0
to: 100
stepSize: 1
PlasmaComponents.ToolTip {
text: panelOffset.value
}
}
Item {
Kirigami.FormData.isSection: true
Expand Down
4 changes: 2 additions & 2 deletions contents/ui/Header.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Item {
anchors.left: parent.left

PlasmaComponents.ToolTip {
text: "Settings"
text: i18n("Settings")
}
Item {
id: visualParentSettings
Expand Down Expand Up @@ -72,7 +72,7 @@ Item {
anchors.right: parent.right

PlasmaComponents.ToolTip {
text: "Power Off"
text: i18n("Power Off")
}
Image {
id: powerImage
Expand Down
10 changes: 7 additions & 3 deletions contents/ui/MainView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Item {
}
}

function updateStartpage(){
appList.currentStateIndex = plasmoid.configuration.defaultPage
}

function reload() {
searchBar.clear()
searchBar.focus = true
Expand Down Expand Up @@ -165,7 +169,7 @@ Item {
font.pixelSize: 13 * PlasmaCore.Units.devicePixelRatio
Text {
anchors.fill: parent
text: 'Search your computer'
text: i18n("Search your computer")
color: plasmoid.configuration.theming == 0 ? "#686B71" : plasmoid.configuration.theming == 1 ? "#798591" : PlasmaCore.Theme.disabledTextColor
visible: !parent.text
}
Expand Down Expand Up @@ -249,7 +253,7 @@ Item {
id: runnerList
model: runnerModel
state: "hidden"
visible: opacity > 0//searching
visible: opacity > 0
anchors.top: backdrop.top
anchors.bottom: backdrop.bottom
width: main.width - 30 * PlasmaCore.Units.devicePixelRatio
Expand Down Expand Up @@ -288,7 +292,7 @@ Item {
radius: isTop ? backdrop.radius : 0
gradient: Gradient {
GradientStop { position: 0.0; color: Qt.darker(backdrop.color, 1.5) }
GradientStop { position: 1.0; color: "transparent" }//"#0d0d0d"
GradientStop { position: 1.0; color: "transparent" }
}
states: [
State {
Expand Down
Loading

0 comments on commit b159b9c

Please sign in to comment.