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 5, 2022
1 parent 81a78fd commit eeff14d
Show file tree
Hide file tree
Showing 12 changed files with 213 additions and 168 deletions.
1 change: 0 additions & 1 deletion contents/ui/ActionMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
***************************************************************************/

import QtQuick 2.0

import org.kde.plasma.components 2.0 as PlasmaComponents

Item {
Expand Down
75 changes: 36 additions & 39 deletions contents/ui/AppList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
****************************************************************************/
import QtQuick 2.12

import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import QtGraphicalEffects 1.0

import org.kde.plasma.private.kicker 0.1 as Kicker
import QtQuick.Window 2.2
import org.kde.plasma.components 3.0 as PlasmaComponents
import QtQuick.Layouts 1.15
import QtQuick 2.12
import QtQuick.Controls 2.15
import org.kde.draganddrop 2.0

import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents

ScrollView {
id: scrollView
Expand All @@ -39,6 +34,8 @@ ScrollView {
width: parent.width
height: parent.height

contentWidth: - 1 //no horizontal scrolling

property bool grabFocus: false
property bool showDescriptions: false
property int iconSize: units.iconSizes.medium
Expand Down Expand Up @@ -78,20 +75,20 @@ ScrollView {
width: parent.width
Item { //Spacer
width: 1
height: 20
height: 20 * PlasmaCore.Units.devicePixelRatio
}
Image {
id: starImage
source: "icons/feather/star.svg"
width: 15
width: 15 * PlasmaCore.Units.devicePixelRatio
height: width
PlasmaComponents.Label {
x: parent.width + 10
x: parent.width + 10 * PlasmaCore.Units.devicePixelRatio
anchors.verticalCenter: parent.verticalCenter
text: "Favorite Apps"
color: main.textColor
font.family: main.textFont
font.pixelSize: 12
font.pixelSize: 12 * PlasmaCore.Units.devicePixelRatio
}
ColorOverlay {
visible: plasmoid.configuration.theming != 0
Expand All @@ -102,13 +99,13 @@ ScrollView {
}
Item { //Spacer
width: 1
height: 10
height: 10 * PlasmaCore.Units.devicePixelRatio
}

Flow { //Favorites
id: flow
x: 0
width: scrollView.width - 10
width: scrollView.width - 10 * PlasmaCore.Units.devicePixelRatio
Repeater {
model: pinnedModel[0]
delegate:
Expand All @@ -120,11 +117,11 @@ ScrollView {

Item { //Spacer
width: 1
height: 24
height: 24 * PlasmaCore.Units.devicePixelRatio
}
Image {
id: sortingImage
width: 15
width: 15 * PlasmaCore.Units.devicePixelRatio
height: width
//I don't like it this way but I have to assign custom images anyways, so it's not too bad... right?
states: [
Expand Down Expand Up @@ -202,16 +199,16 @@ ScrollView {
]
PlasmaComponents.Label {
id: sortingLabel
x: parent.width + 10
x: parent.width + 10 * PlasmaCore.Units.devicePixelRatio
anchors.verticalCenter: parent.verticalCenter
text: "All"
color: main.textColor
font.family: main.textFont
font.pixelSize: 12
font.pixelSize: 12 * PlasmaCore.Units.devicePixelRatio
}
MouseArea {
id: mouseArea
width: parent.width + sortingLabel.width + 5
width: parent.width + sortingLabel.width + 5 * PlasmaCore.Units.devicePixelRatio
height: parent.height
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
Expand Down Expand Up @@ -245,15 +242,15 @@ ScrollView {
Item { //Spacer
id: spacer
width: 1
height: 10
height: 10 * PlasmaCore.Units.devicePixelRatio
}

Grid { //All Apps
Grid { //All Apps // want to convert this to listview later to use verticallayoutdireciton
id: allAppsGrid
x: - 10
x: - 10 * PlasmaCore.Units.devicePixelRatio
columns: 1
width: scrollView.width - 10
//active: opacity == 1
width: scrollView.width - 10 * PlasmaCore.Units.devicePixelRatio
//verticalLayoutDirection: main.isTop ? ListView.BottomToTop : ListView.TopToBottom
visible: opacity > 0
Repeater {
id: allAppsRepeater
Expand All @@ -271,7 +268,7 @@ ScrollView {
State {
name: "hidden"; when: (sortingLabel.text != 'All')
PropertyChanges { target: allAppsGrid; opacity: 0.0 }
PropertyChanges { target: allAppsGrid; x: (!isRight ? -20 : 0) }
PropertyChanges { target: allAppsGrid; x: (!isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0) }
},
State {
name: "shown"; when: (sortingLabel.text == 'All')
Expand All @@ -282,12 +279,12 @@ ScrollView {
Transition {
to: "hidden"
NumberAnimation { properties: 'opacity'; duration: 40;}
NumberAnimation { properties: 'x'; from: -10; duration: 40;}
NumberAnimation { properties: 'x'; from: -10 * PlasmaCore.Units.devicePixelRatio; duration: 40;}
},
Transition {
to: "shown"
NumberAnimation { properties: 'opacity'; duration: 40; }
NumberAnimation { properties: 'x'; from: (isRight ? -20 : 0); duration: 40; }
NumberAnimation { properties: 'x'; from: (isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0); duration: 40; }
}
]
}
Expand All @@ -297,7 +294,7 @@ ScrollView {
id: appCategories
columns: 1
//anchors.top: allAppsGrid.opacity != 1 ? allAppsGrid.top : NULL
width: scrollView.width - 10
width: scrollView.width - 10 * PlasmaCore.Units.devicePixelRatio
visible: opacity > 0
Repeater {
id: categoriesRepeater
Expand All @@ -311,31 +308,31 @@ ScrollView {
State {
name: "hidden"; when: (currentStateIndex % 2 === 1)
PropertyChanges { target: appCategories; opacity: 0.0 }
PropertyChanges { target: appCategories; x: (isRight ? -20 : 0) }
PropertyChanges { target: appCategories; x: (isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0) }
},
State {
name: "shown"; when: (currentStateIndex % 2 === 0)
PropertyChanges { target: appCategories; opacity: 1.0 }
PropertyChanges { target: appCategories; x: -10 }
PropertyChanges { target: appCategories; x: -10 * PlasmaCore.Units.devicePixelRatio }
}]
transitions: [
Transition {
to: "hidden"
NumberAnimation { properties: 'opacity'; duration: 40;}
NumberAnimation { properties: 'x'; from: -10; duration: 40;}
NumberAnimation { properties: 'x'; from: -10 * PlasmaCore.Units.devicePixelRatio; duration: 40;}
},
Transition {
to: "shown"
NumberAnimation { properties: 'opacity'; duration: 40; }
NumberAnimation { properties: 'x'; from: (isRight ? -20 : 0); duration: 40; }
NumberAnimation { properties: 'x'; from: (isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0); duration: 40; }
}
]
}

Grid { //Categories
id: appCategories2
columns: 1
width: scrollView.width - 10
width: scrollView.width - 10 * PlasmaCore.Units.devicePixelRatio
visible: opacity > 0
Repeater {
id: categoriesRepeater2
Expand All @@ -349,30 +346,30 @@ ScrollView {
State {
name: "hidden"; when: (currentStateIndex % 2 === 0)
PropertyChanges { target: appCategories2; opacity: 0.0 }
PropertyChanges { target: appCategories2; x: (isRight ? -20 : 0) }
PropertyChanges { target: appCategories2; x: (isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0) }
},
State {
name: "shown"; when: (currentStateIndex % 2 === 1)
PropertyChanges { target: appCategories2; opacity: 1.0 }
PropertyChanges { target: appCategories2; x: -10 }
PropertyChanges { target: appCategories2; x: -10 * PlasmaCore.Units.devicePixelRatio}
}]
transitions: [
Transition {
to: "hidden"
NumberAnimation { properties: 'opacity'; duration: 40; }
NumberAnimation { properties: 'x'; from: -10; duration: 40; }
NumberAnimation { properties: 'x'; from: -10 * PlasmaCore.Units.devicePixelRatio; duration: 40; }
},
Transition {
to: "shown"
NumberAnimation { properties: 'opacity'; duration: 40; }
NumberAnimation { properties: 'x'; from: (isRight ? -20 : 0);duration: 40; }
NumberAnimation { properties: 'x'; from: (isRight ? -20 * PlasmaCore.Units.devicePixelRatio : 0);duration: 40; }
}
]
}

Item { //Spacer
width: 1
height: 20
height: 20 * PlasmaCore.Units.devicePixelRatio
}
}
}
6 changes: 1 addition & 5 deletions contents/ui/CompactRepresentation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ Item {
width: plasmoid.configuration.activationIndicator ? parent.width * 0.65 : parent.width
height: plasmoid.configuration.activationIndicator ? parent.height * 0.65 : parent.height
anchors.centerIn: parent
//anchors.fill: parent

/*readonly property double aspectRatio: (vertical ? implicitHeight / implicitWidth
: implicitWidth / implicitHeight)*/

source: useCustomButtonImage ? plasmoid.configuration.customButtonImage : plasmoid.configuration.icon

Expand All @@ -52,7 +48,7 @@ Item {
id: indicator
width: 0
anchors.horizontalCenter: parent.horizontalCenter
height: 3
height: 3 * PlasmaCore.Units.devicePixelRatio
radius: 10
y: parent.height + height
color: plasmoid.configuration.indicatorColor
Expand Down
33 changes: 21 additions & 12 deletions contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ Kirigami.FormLayout {
property bool cfg_activationIndicator: plasmoid.configuration.activationIndicator
property color cfg_indicatorColor: plasmoid.configuration.indicatorColor
property bool cfg_enableGreeting: plasmoid.configuration.indicatorColor
property string cfg_defaultState: plasmoid.configuration.defaultState
property string cfg_defaultStateIcon: plasmoid.configuration.defaultStateIcon
property bool cfg_isCentered: plasmoid.configuration.isCentered
property alias cfg_defaultPage: defaultPage.currentIndex
property alias cfg_theming: theming.currentIndex
property alias cfg_useExtraRunners: useExtraRunners.checked
property alias cfg_customGreeting: customGreeting.text
property alias cfg_floating: floating.checked
property alias cfg_launcherPosition: launcherPosition.currentIndex

Button {
id: iconButton
Expand Down Expand Up @@ -191,6 +190,7 @@ Kirigami.FormLayout {
onCheckedChanged: {
plasmoid.configuration.enableGreeting = checked
cfg_enableGreeting = checked
customGreeting.enabled = checked
}
}
TextField {
Expand All @@ -201,14 +201,25 @@ Kirigami.FormLayout {
Item {
Kirigami.FormData.isSection: true
}
ComboBox {
id: launcherPosition
Kirigami.FormData.label: i18n("Launcher Positioning:")
model: [
i18n("Default"),
i18n("Horizontal Center"),
i18n("Screen Center"),
]
onCurrentIndexChanged: {
if (currentIndex == 2) {
floating.enabled = false
} else {
floating.enabled = true
}
}
}
CheckBox {
Kirigami.FormData.label: i18n("In Center:")
text: i18n("Enabled")
checked: plasmoid.configuration.isCentered
onCheckedChanged: {
plasmoid.configuration.isCentered = checked
cfg_isCentered = checked
}
id: floating
text: i18n("Floating")
}
Item {
Kirigami.FormData.isSection: true
Expand Down Expand Up @@ -236,9 +247,7 @@ Kirigami.FormLayout {
}
CheckBox {
id: useExtraRunners

Kirigami.FormData.label: i18n("Search:")

text: i18n("Expand search to bookmarks, files and emails")
}
Item {
Expand Down
23 changes: 11 additions & 12 deletions contents/ui/FavoriteItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kcoreaddons 1.0 as KCoreAddons
import org.kde.kirigami 2.13 as Kirigami
import QtQuick.Controls 2.15

import "../code/tools.js" as Tools

Item {
id: favItem
width: rect.width + 10
height: rect.height + 10
width: rect.width + 10 * PlasmaCore.Units.devicePixelRatio
height: rect.height + 10 * PlasmaCore.Units.devicePixelRatio

signal itemActivated(int index, string actionId, string argument)

Expand All @@ -59,30 +58,30 @@ Item {
}
Rectangle {
id: rect
x: 10
y: 10
width: appname.width + appicon.width + 3 * 10 + 5
height: 45//40
x: 10 * PlasmaCore.Units.devicePixelRatio
y: 10 * PlasmaCore.Units.devicePixelRatio
width: appname.width + appicon.width + 3 * (10 * PlasmaCore.Units.devicePixelRatio) + 5 * PlasmaCore.Units.devicePixelRatio
height: 45 * PlasmaCore.Units.devicePixelRatio
z: -20
color: plasmoid.configuration.theming == 0 ? "#202124" : plasmoid.configuration.theming == 1 ? "#E0E1E3" : PlasmaCore.Theme.buttonBackgroundColor
border.color: "transparent" //Qt.darker(color, 1.05) //plasmoid.configuration.theming == 0 ? "141516" : plasmoid.configuration.theming == 1 ? "#FAFAFA" : PlasmaCore.Theme.buttonAlternateBackgroundColor
border.color: "transparent"
border.width: 1
radius: 6
PlasmaCore.IconItem {
x: 10
x: 10 * PlasmaCore.Units.devicePixelRatio
anchors.verticalCenter: rect.verticalCenter
id: appicon
width: 25
width: 25 * PlasmaCore.Units.devicePixelRatio
height: width
source: model.decoration
PlasmaComponents.Label {
id: appname
x: appicon.width + 10
x: appicon.width + 10 * PlasmaCore.Units.devicePixelRatio
anchors.verticalCenter: appicon.verticalCenter
text: ("name" in model ? model.name : model.display)
color: plasmoid.configuration.theming != 2 ? main.textColor : PlasmaCore.Theme.buttonTextColor
font.family: main.textFont
font.pixelSize: 12
font.pixelSize: 12 * PlasmaCore.Units.devicePixelRatio
}
}
states: [
Expand Down
Loading

0 comments on commit eeff14d

Please sign in to comment.