Commit 5a227aa8 authored by Camilo Higuita's avatar Camilo Higuita

try to use sidebar/toolbar design... and maybe not

parent f81d30df
kirigami @ 0d2e7c34
Subproject commit 0c578797c7274c74cfd19d170cab09d90e71370e
Subproject commit 0d2e7c34ad8baf830a458b9f435984cb4ad189af
QT += qml quick quickcontrols2 sql widgets
#android:
#{
# include(3rdparty/kirigami/kirigami.pri)
#}
android:
{
include(3rdparty/kirigami/kirigami.pri)
}
CONFIG += c++11
......@@ -39,10 +39,8 @@ SUBDIRS += \
src/Pixs.pro
RESOURCES += \
src/qml.qrc
DISTFILES += \
src/qtquickcontrols2.conf \
src/qml.qrc \
kirigami-icons.qrc
HEADERS += \
src/utils/pix.h \
......
<RCC>
<qresource prefix="/">
<file alias="org/kde/kirigami/icons/application-menu.svg">3rdparty/breeze-icons/icons/actions/32/application-menu.svg</file>
<file alias="org/kde/kirigami/icons/document-decrypt.svg">3rdparty/breeze-icons/icons/actions/32/document-decrypt.svg</file>
<file alias="org/kde/kirigami/icons/folder-sync.svg">3rdparty/breeze-icons/icons/actions/32/folder-sync.svg</file>
<file alias="org/kde/kirigami/icons/go-next-symbolic.svg">3rdparty/breeze-icons/icons/actions/symbolic/go-next-symbolic.svg</file>
<file alias="org/kde/kirigami/icons/go-previous-symbolic.svg">3rdparty/breeze-icons/icons/actions/symbolic/go-previous-symbolic.svg</file>
<file alias="org/kde/kirigami/icons/go-up.svg">3rdparty/breeze-icons/icons/actions/22/go-up.svg</file>
<file alias="org/kde/kirigami/icons/handle-left.svg">3rdparty/breeze-icons/icons/actions/22/handle-left.svg</file>
<file alias="org/kde/kirigami/icons/overflow-menu.svg">3rdparty/breeze-icons/icons/actions/22/overflow-menu.svg</file>
<file alias="org/kde/kirigami/icons/handle-right.svg">3rdparty/breeze-icons/icons/actions/22/handle-right.svg</file>
<file alias="org/kde/kirigami/icons/view-list-icons.svg">3rdparty/breeze-icons/icons/actions/32/view-list-icons.svg</file>
<file alias="org/kde/kirigami/icons/applications-graphics.svg">3rdparty/breeze-icons/icons/categories/32/applications-graphics.svg</file>
<file alias="org/kde/kirigami/icons/media-record-symbolic.svg">3rdparty/breeze-icons/icons/actions/symbolic/media-record-symbolic.svg</file>
<file>3rdparty/breeze-icons/icons/actions/22/folder-new.svg</file>
<file>3rdparty/breeze-icons/icons/places/22/folder.svg</file>
</qresource>
</RCC>
......@@ -5,9 +5,9 @@
#include <QQuickStyle>
#include "src/utils/pix.h"
//#ifdef Q_OS_ANDROID
//#include "./3rdparty/kirigami/src/kirigamiplugin.h"
//#endif
#ifdef Q_OS_ANDROID
#include "./3rdparty/kirigami/src/kirigamiplugin.h"
#endif
int main(int argc, char *argv[])
{
......@@ -17,12 +17,13 @@ int main(int argc, char *argv[])
QFontDatabase::addApplicationFont(":/utils/materialdesignicons-webfont.ttf");
// #ifdef Q_OS_ANDROID
// KirigamiPlugin::getInstance().registerTypes();
// #endif
#ifdef Q_OS_ANDROID
KirigamiPlugin::getInstance().registerTypes();
#endif
QQmlApplicationEngine engine;
auto context = engine.rootContext();
QQuickStyle::setStyle("qqc2-desktop-style");
Pix pix;
context->setContextProperty("pix", &pix);
......
import QtQuick 2.9
import QtQuick.Controls 2.2
//import org.kde.kirigami 2.0 as Kirigami
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.0 as Kirigami
import "widgets"
import "view_models"
ApplicationWindow
Kirigami.ApplicationWindow
{
id: root
visible: true
......@@ -13,35 +15,46 @@ ApplicationWindow
title: qsTr("Pixs")
property int currentView : 0
property int columnWidth: 32
pageStack.defaultColumnWidth: columnWidth
pageStack.initialPage: [sidebar, stackView]
pageStack.separatorVisible: pageStack.wideMode
property string backgroundColor: Kirigami.Theme.backgroundColor
property string textColor: Kirigami.Theme.textColor
property string highlightColor: Kirigami.Theme.highlightColor
property string highlightedTextColor: Kirigami.Theme.highlightedTextColor
property string buttonBackgroundColor: Kirigami.Theme.buttonBackgroundColor
property string viewBackgroundColor: Kirigami.Theme.viewBackgroundColor
// header: PixsBar
// {
// id: toolBar
// visible: true
// size: 24
// currentIndex: currentView
// onViewerViewClicked: currentView = 0
// onGalleryViewClicked: currentView = 1
// onFoldersViewClicked: currentView = 2
// onAlbumsViewClicked: currentView = 3
// onTagsViewClicked: currentView = 4
// onSettingsViewClicked: {}
// }
header: PixsBar
{
id: toolBar
visible: true
size: 24
currentIndex: currentView
onViewerViewClicked: currentView = 0
onGalleryViewClicked: currentView = 1
onFoldersViewClicked: currentView = 2
onAlbumsViewClicked: currentView = 3
onTagsViewClicked: currentView = 4
onSettingsViewClicked: {}
}
Rectangle
SideBar
{
anchors.fill: parent
color: pix.altColor()
z: -999
id: sidebar
}
StackView
{
id: stackView
anchors.fill: parent
initialItem: SwipeView
{
id: swipeView
......@@ -90,5 +103,8 @@ ApplicationWindow
}
}
}
}
......@@ -20,5 +20,7 @@
<file>../assets/face.png</file>
<file>../assets/Babe.notifyrc</file>
<file>db/Query.js</file>
<file>view_models/SideBar.qml</file>
<file>view_models/PixButton.qml</file>
</qresource>
</RCC>
import QtQuick 2.9
import QtQuick.Controls 2.2
import "../utils"
import org.kde.kirigami 2.2 as Kirigami
ToolButton
{
id: babeButton
property string iconName
property int iconSize : 22
property color iconColor: textColor
readonly property string defaultColor : textColor
property bool anim : false
icon.name: iconName
icon.width: iconSize
icon.height: iconSize
icon.color: iconColor
onClicked: if(anim) animIcon.running = true
flat: true
highlighted: false
SequentialAnimation
{
id: animIcon
PropertyAnimation
{
target: babeButton
property: "color"
easing.type: Easing.InOutQuad
from: pix.pixColor()
to: iconColor
duration: 500
}
}
}
import QtQuick 2.0
import org.kde.kirigami 2.2 as Kirigami
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import "../utils/Icons.js" as MdiFont
import "../utils"
Item
{
id: sidebarRoot
readonly property int minWidth : 32
readonly property int maxWidth : 120
property bool isExanped : false
width: isExanped ? maxWidth : minWidth
height: parent.height
parent: ApplicationWindow.overlay
// Rectangle
// {
// id: sidebarBg
// anchors.fill: parent
// color : "pink"
// Kirigami.Separator
// {
// anchors.right: parent.right
// }
// }
Column
{
anchors.fill: parent
anchors.top: parent.top
PixButton
{
anchors.horizontalCenter: parent.horizontalCenter
id: menu
iconName: "application-menu"
onClicked:
{
if(isExanped)
{
columnWidth = minWidth
isExanped = false
}else
{
columnWidth = maxWidth
isExanped = true
}
}
}
PixButton
{
anchors.horizontalCenter: parent.horizontalCenter
id: viewer
iconName: "fileview-preview"
text: "Viewer"
display: isExanped ? AbstractButton.TextBesideIcon : AbstractButton.IconOnly
}
PixButton
{
anchors.horizontalCenter: parent.horizontalCenter
iconName: "folder-pictures"
text: "Gallery"
display: isExanped ? AbstractButton.TextBesideIcon : AbstractButton.IconOnly
}
PixButton
{
anchors.horizontalCenter: parent.horizontalCenter
iconName: "folder"
text: "Folders"
display: isExanped ? AbstractButton.TextBesideIcon : AbstractButton.IconOnly
}
PixButton
{
anchors.horizontalCenter: parent.horizontalCenter
iconName: "view-group"
text: "Albums"
display: isExanped ? AbstractButton.TextBesideIcon : AbstractButton.IconOnly
}
PixButton
{
anchors.horizontalCenter: parent.horizontalCenter
iconName: "tag"
text: "Tags"
display: isExanped ? AbstractButton.TextBesideIcon : AbstractButton.IconOnly
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment