Skip to content

Commit

Permalink
switch other icons over to material, clean up main.qml
Browse files Browse the repository at this point in the history
  • Loading branch information
mgn-norm committed Mar 19, 2022
1 parent 586eab5 commit 84bc2c3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 71 deletions.
6 changes: 4 additions & 2 deletions src/qml/MangaDetails.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import QtWebSockets

import Tachidesk.Models 1.0

import "../../libs/QmlBridgeForMaterialDesignIcons/Icon.js" as MdiFont

Item {
id: base
property alias mangaNumber: detailsModel.mangaNumber
Expand Down Expand Up @@ -208,7 +210,7 @@ Item {
Button {
Layout.fillWidth: true
Layout.fillHeight: true
text: details.inLibrary ? qsTr("\nIn Library") : qsTr("\nAdd to Library")
text: details.inLibrary ? qsTr("%1\nIn Library").arg(MdiFont.Icon.heart) : qsTr("%1\nAdd to Library").arg(MdiFont.Icon.heartPlusOutline)
onClicked: {
mangaChanged()
details.inLibrary ? detailsModel.removeFromLibrary() : detailsModel.addToLibrary()
Expand Down Expand Up @@ -314,7 +316,7 @@ Item {
visible: progress < 0 || progress >= 100
anchors.fill: parent
color: "#F5F5F5"
text: downloaded ? "" : ""
text: downloaded ? MdiFont.Icon.checkCircle : MdiFont.Icon.downloadCircleOutline
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
rightPadding: 12
Expand Down
6 changes: 5 additions & 1 deletion src/qml/Updates.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import QtQuick.Layouts 1.0
import Tachidesk.Models 1.0
import SortFilterProxyModel 0.2

import "../../libs/QmlBridgeForMaterialDesignIcons/Icon.js" as MdiFont

Rectangle {

color: "#212121"
Expand Down Expand Up @@ -131,7 +133,9 @@ Rectangle {
anchors.centerIn: parent
visible: downloadProgress < 0 || downloadProgress >= 100
Text {
text: downloaded ? "" : ""
text: downloaded ? MdiFont.Icon.checkCircle : MdiFont.Icon.downloadCircleOutline
horizontalAlignment: Text.AlignCenter
verticalAlignment: Text.AlignVCenter
color: "#F5F5F5"
anchors.centerIn: parent
font.bold: true
Expand Down
70 changes: 2 additions & 68 deletions src/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ApplicationWindow {
id: root

// Application main font
//font.family: Settings.font || appFont.name
font.family: "Roboto"//Settings.font || appFont.name

height: 800
width: 400
Expand All @@ -20,67 +20,12 @@ ApplicationWindow {
root.visibility = changeTo
}

//Labs.Settings {
// id: windowSettings
// property var windowX
// property var windowY
// property var windowWidth
// property var windowHeight
// property var windowVisibility
// function update() {
// Qt.callLater(function() {
// if (visibility === Window.Windowed) {
// windowX = x
// windowY = y
// windowWidth = width
// windowHeight = height
// }
// windowVisibility = visibility
// })
// }
// Component.onCompleted: {
// if (isMobile()) return
// if (visibility === Window.Windowed) {
// x = windowX !== undefined ? windowX : x
// y = windowY !== undefined ? windowY : y
// width = windowWidth !== undefined ? windowWidth : width
// height = windowHeight !== undefined ? windowHeight : height
// visibility = windowVisibility === Window.Maximized ? windowVisibility : visibility
// }
// root.onXChanged.connect(update)
// root.onYChanged.connect(update)
// root.onWidthChanged.connect(update)
// root.onHeightChanged.connect(update)
// root.onVisibilityChanged.connect(update)
// }
//}

// Style settings
Material.theme: settings.lightTheme ? Material.Light : Material.Dark

title: "Tachidesk-qtui"

//visibility: (!isMobile() && Settings.minimizeOnStartup) ? Window.Minimized : Window.AutomaticVisibility

property int restoredVisibility: Window.AutomaticVisibility
//onAppFullScreenChanged: {
// if (visibility != Window.FullScreen) {
// restoredVisibility = visibility
// }
// visibility = appFullScreen ? Window.FullScreen : restoredVisibility
//}
title: "Tachidesk Qtui"

property variant rootWindow: root
property variant g_tooltip
property bool g_contextMenuVisible: false
//property bool appFullScreen: isMobile() ? (view.playerVisible && !isPortraitMode) : false
property bool isPortraitMode: Screen.primaryOrientation === Qt.PortraitOrientation
|| Screen.primaryOrientation === Qt.InvertedPortraitOrientation

//function fitToAspectRatio() {
// height = Math.floor(view.width * 0.5625)
//}

function isMobile() {
return {android: true, ios: true, winphone: true}[Qt.platform.os] || false;
}
Expand Down Expand Up @@ -128,16 +73,5 @@ ApplicationWindow {
}
}

//FontLoader {
// source: "fonts/MaterialIcons-Regular.ttf"
// name: "Material Icons"
//}

//FontLoader {
// id: appFont

// source: "fonts/NotoSans-Regular.ttf"
// name: "Noto Sans"
//}
}

0 comments on commit 84bc2c3

Please sign in to comment.