Commit c0552bba authored by Karel Slaný's avatar Karel Slaný
Browse files

Tried removing the ellipsis (elide?) from pop-up menus.

parent f5deff21
......@@ -221,4 +221,24 @@ ApplicationWindow {
}
}
}
Text {
id: dummyText
text: ""
visible: false
wrapMode: Text.NoWrap
elide: Text.ElideNone
}
function computeMenuWidth(menu) {
var w = 0
for (var i = 0; i < menu.contentData.length; i++) {
dummyText.text = menu.contentData[i].text
if (w < dummyText.width) {
w = dummyText.width
}
}
dummyText.text = ""
w = Math.round(w * 1.05)
console.log("width " + w)
return w
}
}
......@@ -72,6 +72,7 @@ Component {
source: "qrc:/ui/settings.svg"
Menu {
id: mainContextMenu
implicitWidth: 800 // Chosen to be large enough
MenuItem {
text: qsTr("Add account")
//iconSource: "qrc:/ui/account-plus.svg"
......@@ -101,6 +102,7 @@ Component {
MouseArea {
anchors.fill: parent
onClicked: {
mainContextMenu.implicitWidth = computeMenuWidth(mainContextMenu)
// Located in right top corner.
mainContextMenu.x = mouse.x - mainContextMenu.width
mainContextMenu.y = mouse.y
......@@ -174,6 +176,7 @@ Component {
font.bold: true
Menu {
id: accountContextMenu
implicitWidth: 800 // Chosen to be large enough
MenuItem {
text: qsTr("Account settings")
//iconSource: "qrc:/ui/account-key.svg"
......@@ -259,6 +262,7 @@ Component {
anchors.fill: parent
onClicked: {
statusBar.visible = false
accountContextMenu.implicitWidth = computeMenuWidth(accountContextMenu)
// Located in left top corner.
accountContextMenu.x = mouse.x
accountContextMenu.y = mouse.y
......
......@@ -102,6 +102,7 @@ Component {
source: "qrc:/ui/settings.svg"
Menu {
id: mainContextMenu2
implicitWidth: 800 // Chosen to be large enough
MenuItem {
id: markAllAsRead
text: qsTr("Mark all as read")
......@@ -123,6 +124,7 @@ Component {
anchors.fill: parent
onClicked: {
statusBar.visible = false
mainContextMenu2.implicitWidth = computeMenuWidth(mainContextMenu2)
// Located in right top corner.
mainContextMenu2.x = mouse.x - mainContextMenu2.width
mainContextMenu2.y = mouse.y
......
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