Hi,
I'm writing a simple Android/IOS app using qml, but for the live of me I can't figure out, if there is a way to
change the toolbar background color without effecting any other element of the style.
What I'm currently at is this:
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.4
ApplicationWindow {
title: "HAL 9000"
height: 960
width: 600
color: "white"
visible: true
menuBar: MenuBar {
Menu {
title: "Views"
[...]
}
}
toolBar: ToolBar {
[...]
style: ToolBarStyle {
panel: Rectangle {
color: "blue"
}
}
}
}
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.4
ApplicationWindow {
title: "HAL 9000"
height: 960
width: 600
color: "white"
visible: true
menuBar: MenuBar {
Menu {
title: "Views"
[...]
}
}
toolBar: ToolBar {
[...]
style: ToolBarStyle {
panel: Rectangle {
color: "blue"
}
}
}
}
To copy to clipboard, switch view to plain text mode
While this does change the color correctly, the problem is that the menu-botton is invisible/non-existant since my ToolBarStyle does not contain anything for its menuButton property.
Since I only want to change the background color (of the toolbar) without having to "reimplement" the default implementation of the menuButton property, I do wonder if there is a way to simple change color, eg. via toolBar.style.panel.color: "pink"?
Any help would be greatly appreciated...
Bookmarks