Commit fd565c1a authored by Camilo Higuita's avatar Camilo Higuita

add contextual actionbar to browser and fix issue with not showing the...

add contextual actionbar to browser and fix issue with not showing the terminal when building on qmake
parent 7fc76768
......@@ -2,3 +2,31 @@ function bookmarkFolders(urls)
{
}
function showPreviews()
{
browser.previews = !browser.previews
Maui.FM.setDirConf(browser.currentPath+"/.directory", "MAUIFM", "ShowThumbnail", browser.previews)
}
function showHiddenFiles()
{
var state = Maui.FM.dirConf(browser.currentPath+"/.directory").hidden
Maui.FM.setDirConf(browser.currentPath+"/.directory", "Settings", "HiddenFilesShown", !state)
browser.refresh()
}
function createFolder()
{
newFolderDialog.open()
}
function createFile()
{
newFileDialog.open()
}
function bookmarkFolder()
{
browser.bookmarkFolder([browser.currentPath])
}
......@@ -3,8 +3,8 @@ QT += quick
QT += sql
CONFIG += c++11
TARGET = index
DESTDIR = $$OUT_PWD/../
linux:unix:!android {
......
......@@ -30,10 +30,13 @@ Maui.ApplicationWindow
altColor: "#43455a"
altToolBars: false
altColorText: "#ffffff"
property color headBarColor: "#bdc8e5"
// headBarBG.color: headBarColor
headBar.middleContent: Maui.PathBar
{
id: pathBar
// pathBarBG.color:Qt.lighter(headBarColor, 1.1)
height: iconSizes.big
width: headBar.middleLayout.width * 0.9
onPathChanged: browser.openFolder(path)
......@@ -72,6 +75,7 @@ Maui.ApplicationWindow
Component.onCompleted:
{
browser.openFolder(inx.homePath())
}
}
......@@ -151,4 +155,14 @@ Maui.ApplicationWindow
{
id:fmDialog
}
Component.onCompleted:
{
// if(!isAndroid)
// Maui.KDE.setColorScheme("index", headBarColor, textColor)
// if(isAndroid)
// switchColorScheme(colorScheme.Dark)
}
}
......@@ -5,6 +5,7 @@ import "../../widgets_templates"
import "../terminal"
import org.kde.kirigami 2.0 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "../../Index.js" as INX
Maui.Page
{
......@@ -122,7 +123,6 @@ Maui.Page
}
focus: true
headBarVisible: false
Maui.Holder
{
......@@ -140,6 +140,41 @@ Maui.Page
floatingBar: true
footBarOverlap: true
headBarExit: false
headBar.rightContent: [
Maui.ToolButton
{
iconName: "visibility"
onClicked: INX.showHiddenFiles()
},
Maui.ToolButton
{
iconName: "view-preview"
onClicked: INX.showPreviews()
},
Maui.ToolButton
{
iconName: "bookmark-new"
onClicked: INX.bookmarkFolder()
}
]
headBar.leftContent: [
Maui.ToolButton
{
iconName: "folder-add"
onClicked: INX.createFolder()
},
Maui.ToolButton
{
iconName: "sort-name"
}
]
footBar.leftContent: Maui.ToolButton
{
......@@ -276,6 +311,7 @@ Maui.Page
visible: terminalVisible
focus: true
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignBottom
Layout.minimumHeight: 100
Layout.maximumHeight: parent.height *0.5
......
......@@ -47,8 +47,7 @@ Menu
text: qsTr("Show previews")
onTriggered:
{
browser.previews = !browser.previews
Maui.FM.setDirConf(browser.currentPath+"/.directory", "MAUIFM", "ShowThumbnail", browser.previews)
INX.showPreviews()
close()
}
}
......@@ -58,10 +57,7 @@ Menu
text: qsTr("Show hidden files")
onTriggered:
{
var state = Maui.FM.dirConf(browser.currentPath+"/.directory").hidden
console.log(state)
Maui.FM.setDirConf(browser.currentPath+"/.directory", "Settings", "HiddenFilesShown", !state)
browser.refresh()
INX.showHiddenFiles()
close()
}
}
......@@ -70,19 +66,19 @@ Menu
MenuItem
{
text: qsTr("New folder")
onTriggered: newFolderDialog.open()
onTriggered: INX.createFolder()
}
MenuItem
{
text: qsTr("New file")
onTriggered: newFileDialog.open()
onTriggered: INX.createFile()
}
MenuItem
{
text: qsTr("Bookmark")
onTriggered: browser.bookmarkFolder([browser.currentPath])
onTriggered: INX.bookmarkFolder()
}
MenuSeparator { }
......
......@@ -6,6 +6,6 @@ SUBDIRS += app
linux:unix:!android {
message(Building Terminal for Linux KDE)
SUBDIRS += kde/qmltermwidget
SUBDIRS += $$PWD/kde/qmltermwidget
}
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