Commit 8d82a18b authored by camilo higuita's avatar camilo higuita
Browse files

move viewer out of component to be quickly reused

parent df722f6b
......@@ -17,8 +17,8 @@ Standard: Cpp11
# 4 spaces indent
TabWidth: 4
# 2 * 80 wide lines
ColumnLimit: 160
# 3 * 80 wide lines
ColumnLimit: 240
# sort includes inside line separated groups
SortIncludes: true
......@@ -47,9 +47,8 @@ BinPackArguments: false
# don't move parameters to own lines if they are not all on the same
BinPackParameters: false
# In case we have an if statement whith multiple lines the operator should be at the beginning of the line
# but we do not want to break assignments
BreakBeforeBinaryOperators: NonAssignment
# don't break binary ops
BreakBeforeBinaryOperators: None
# format C++11 braced lists like function calls
Cpp11BracedListStyle: true
......
......@@ -81,7 +81,6 @@ Maui.ApplicationWindow
Settings
{
id: viewerSettings
category: "Viewer"
property bool tagBarVisible : true
property bool previewBarVisible : false
}
......@@ -158,38 +157,35 @@ Maui.ApplicationWindow
}
}
Component
PixViewer
{
id: _pixViewer
visible: StackView.status === StackView.Active
PixViewer
Rectangle
{
anchors.fill: parent
visible: _dropArea.containsDrag
color: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.95)
Rectangle
Maui.Rectangle
{
anchors.fill: parent
visible: _dropArea.containsDrag
color: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.95)
anchors.margins: Maui.Style.space.medium
color: "transparent"
borderColor: Kirigami.Theme.textColor
solidBorder: false
Maui.Rectangle
Maui.Holder
{
anchors.fill: parent
anchors.margins: Maui.Style.space.medium
color: "transparent"
borderColor: Kirigami.Theme.textColor
solidBorder: false
Maui.Holder
{
anchors.fill: parent
visible: true
emoji: "qrc:/img/assets/add-image.svg"
emojiSize: Maui.Style.iconSizes.huge
title: i18n("Open images")
body: i18n("Drag and drop images here")
}
visible: true
emoji: "qrc:/img/assets/add-image.svg"
emojiSize: Maui.Style.iconSizes.huge
title: i18n("Open images")
body: i18n("Drag and drop images here")
}
}
}
......@@ -259,7 +255,7 @@ Maui.ApplicationWindow
{
settings.filterType: Maui.FMList.IMAGE
settings.onlyDirs: true
mode: modes.OPEN
mode: modes.OPEN
}
}
......@@ -331,4 +327,26 @@ Maui.ApplicationWindow
dialog.url = url
dialog.open()
}
function toogleTagbar()
{
viewerSettings.tagBarVisible = !viewerSettings.tagBarVisible
}
function tooglePreviewBar()
{
viewerSettings.previewBarVisible = !viewerSettings.previewBarVisible
}
function toogleFullscreen()
{
if(Window.window.visibility === Window.FullScreen)
{
Window.window.showNormal()
}else
{
Window.window.showFullScreen()
}
}
}
......@@ -212,7 +212,7 @@ Maui.SettingsDialog
Layout.fillHeight: true
checkable: true
checked: viewerSettings.tagBarVisible
onToggled: pixViewer.toogleTagbar()
onToggled: toogleTagbar()
}
}
......@@ -225,7 +225,7 @@ Maui.SettingsDialog
Layout.fillHeight: true
checkable: true
checked: viewerSettings.previewBarVisible
onToggled: pixViewer.tooglePreviewBar()
onToggled: tooglePreviewBar()
}
}
}
......
......@@ -102,7 +102,7 @@ StackView
{
visible: !Kirigami.Settings.isMobile
icon.name: "view-fullscreen"
onClicked: control.toogleFullscreen()
onClicked: toogleFullscreen()
checked: fullScreen
}
......@@ -250,28 +250,6 @@ StackView
}
}
function toogleTagbar()
{
viewerSettings.tagBarVisible = !viewerSettings.tagBarVisible
}
function tooglePreviewBar()
{
viewerSettings.previewBarVisible = !viewerSettings.previewBarVisible
}
function toogleFullscreen()
{
if(Window.window.visibility === Window.FullScreen)
{
Window.window.showNormal()
}else
{
Window.window.showFullScreen()
}
}
function next()
{
var index = control.currentPicIndex
......
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