fixed font resizing
This commit is contained in:
parent
dd17ff43b2
commit
40aec194bd
7 changed files with 101 additions and 69 deletions
18
main.qml
18
main.qml
|
@ -19,6 +19,9 @@ ApplicationWindow {
|
|||
property Sidebar sidebar: sidebar
|
||||
property Content content: content
|
||||
|
||||
property int defaultTextFontSize: 13
|
||||
property int textFontSize: defaultTextFontSize
|
||||
|
||||
Settings {
|
||||
category: "window"
|
||||
property alias x: app.x
|
||||
|
@ -26,6 +29,7 @@ ApplicationWindow {
|
|||
property alias width: app.width
|
||||
property alias height: app.height
|
||||
property alias sidebarWidth: sidebar.width
|
||||
//property alias textFontSize: app.textFontSize
|
||||
}
|
||||
|
||||
property TheMenuBar menu: TheMenuBar {
|
||||
|
@ -41,6 +45,18 @@ ApplicationWindow {
|
|||
server.initialize(serverLogin.serverUrl, serverLogin.sessionId);
|
||||
}
|
||||
|
||||
function zoomIn() {
|
||||
textFontSize *= 1.2
|
||||
}
|
||||
|
||||
function zoomOut() {
|
||||
textFontSize *= 0.8
|
||||
}
|
||||
|
||||
function zoomReset() {
|
||||
textFontSize = defaultTextFontSize
|
||||
}
|
||||
|
||||
function keyPressed(event) {
|
||||
switch (event.key) {
|
||||
case Qt.Key_Right:
|
||||
|
@ -94,6 +110,7 @@ ApplicationWindow {
|
|||
|
||||
Layout.minimumWidth: 200
|
||||
implicitWidth: 300
|
||||
textFontSize: app.textFontSize
|
||||
}
|
||||
|
||||
Content {
|
||||
|
@ -102,6 +119,7 @@ ApplicationWindow {
|
|||
|
||||
Layout.minimumWidth: 200
|
||||
implicitWidth: 624
|
||||
textFontSize: app.textFontSize
|
||||
}
|
||||
|
||||
Keys.onPressed: keyPressed(event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue