Skip to content
Snippets Groups Projects
Commit b060dd53 authored by SeeLook's avatar SeeLook
Browse files

Mark keyboard focus of custom controls. Possible solution (disabled) to have...

Mark keyboard focus of custom controls. Possible solution (disabled) to have shortcuts of score control (without it works only for main score)
parent 9771f42f
No related branches found
No related tags found
No related merge requests found
1.5.2 alpha3 1.5.2 alpha3
- extended grand staff, beaming notes on every staff separately - extended grand staff, beaming notes on every staff separately
- score supports bowing symbols, read them from XML - score supports bowing symbols, read them from XML
- keyboard shortcuts for changing rhythm, accidentals, etc.
- all playing routines moved to separate thread - all playing routines moved to separate thread
- improved level creator - improved level creator
......
...@@ -91,6 +91,11 @@ Flickable { ...@@ -91,6 +91,11 @@ Flickable {
} }
Score { Score {
id: score id: score
// onFocusChanged: { // FIXME: workaround to make score keyboard shortcuts working, but it stop other controls TAB navigation
// if (!focus)
// focus = true
// }
// bgRect.border { width: score.activeFocus ? 2 : 0; color: activPal.highlight }
height: Noo.fontSize() * 20 height: Noo.fontSize() * 20
width: Math.min(parent.width * 0.9, Noo.fontSize() * 26) width: Math.min(parent.width * 0.9, Noo.fontSize() * 26)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
...@@ -100,6 +105,7 @@ Flickable { ...@@ -100,6 +105,7 @@ Flickable {
Component.onCompleted: { Component.onCompleted: {
stringNrSpin.valueModified.connect(strNrChanged) stringNrSpin.valueModified.connect(strNrChanged)
tuningCombo.activated.connect(tuningSelected) tuningCombo.activated.connect(tuningSelected)
focus = true
} }
function strNrChanged() { function strNrChanged() {
if (stringNrSpin.value > score.notesCount) { if (stringNrSpin.value > score.notesCount) {
......
...@@ -18,7 +18,10 @@ CheckBox { ...@@ -18,7 +18,10 @@ CheckBox {
x: chB.leftPadding x: chB.leftPadding
y: chB.height / 2 - height / 2 y: chB.height / 2 - height / 2
radius: Noo.fontSize() * 0.1 radius: Noo.fontSize() * 0.1
border.color: chB.enabled ? (chB.down ? activPal.highlight : activPal.dark) : disdPal.text border {
color: chB.enabled ? (chB.down ? activPal.highlight : activPal.dark) : disdPal.text
width: chB.activeFocus ? 3 : 1
}
color: chB.enabled ? activPal.base : disdPal.base color: chB.enabled ? activPal.base : disdPal.base
Rectangle { Rectangle {
...@@ -38,6 +41,6 @@ CheckBox { ...@@ -38,6 +41,6 @@ CheckBox {
y: (chB.height - height) / 2 y: (chB.height - height) / 2
leftPadding: indicator.width + font.pixelSize / 2 leftPadding: indicator.width + font.pixelSize / 2
color: chB.enabled ? activPal.text : disdPal.text color: chB.enabled ? activPal.text : disdPal.text
font { family: chB.font.family; pixelSize: chB.font.pixelSize } font { family: chB.font.family; pixelSize: chB.font.pixelSize; bold: chB.activeFocus }
} }
} }
...@@ -8,7 +8,8 @@ import QtQuick.Controls 2.2 ...@@ -8,7 +8,8 @@ import QtQuick.Controls 2.2
AbstractButton { AbstractButton {
id: root id: root
font.pixelSize: Noo.fontSize() font { pixelSize: Noo.fontSize(); bold: activeFocus }
focus: true
property alias radius: bg.radius property alias radius: bg.radius
property alias color: bg.color property alias color: bg.color
......
/** This file is part of Nootka (http://nootka.sf.net) * /** This file is part of Nootka (http://nootka.sf.net) *
* Copyright (C) 2017 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2017-2018 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import QtQuick 2.9 import QtQuick 2.9
...@@ -8,7 +8,8 @@ import QtQuick.Controls 2.2 ...@@ -8,7 +8,8 @@ import QtQuick.Controls 2.2
AbstractButton { AbstractButton {
id: root id: root
font.pixelSize: Noo.fontSize() font { pixelSize: Noo.fontSize(); bold: activeFocus }
focus: true
property alias radius: bg.radius property alias radius: bg.radius
property alias color: bg.color property alias color: bg.color
...@@ -24,6 +25,7 @@ AbstractButton { ...@@ -24,6 +25,7 @@ AbstractButton {
id: img id: img
sourceSize.height: Noo.fontSize() * 2 sourceSize.height: Noo.fontSize() * 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
scale: root.activeFocus ? 1.1 : 1.0
} }
Text { Text {
padding: Noo.fontSize() / 3 padding: Noo.fontSize() / 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment