Changeset View
Standalone View
src/qtquick/qml/EntryDetails.qml
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | 41 | KCM.SimpleKCM { | |||
---|---|---|---|---|---|
86 | 86 | | |||
87 | NewStuff.Author { | 87 | NewStuff.Author { | ||
88 | id: entryAuthor | 88 | id: entryAuthor | ||
89 | engine: component.newStuffModel.engine | 89 | engine: component.newStuffModel.engine | ||
90 | providerId: component.providerId | 90 | providerId: component.providerId | ||
91 | username: author.name | 91 | username: author.name | ||
92 | } | 92 | } | ||
93 | title: i18nc("Combined title for the entry details page made of the name of the entry, and the author's name", "%1 by %2").arg(component.name).arg(entryAuthor.name) | 93 | title: i18nc("Combined title for the entry details page made of the name of the entry, and the author's name", "%1 by %2").arg(component.name).arg(entryAuthor.name) | ||
94 | titleDelegate: QtLayouts.RowLayout { | 94 | titleDelegate: QtLayouts.RowLayout { | ||
95 | implicitWidth: root.width | ||||
ngraham: I don't think this works, since it's not inside another layout. Instead maybe `anchors.fill… | |||||
It does not. I am also unsure whether anchors.fill will work, since the titleDelegate is instantiated by a loader and its sizing behaviour is somewhat fuzzy. The only option that is guaranteed to work is setting a proper implicitWidth for the delegate. I actually spent some time trying to get balanced auto sizing behaviour working for titles when doing the ActionToolBar work, but in the end gave up because things get really tricky when you have two items that resize based on the size of the other item. ahiemstra: It does not. I am also unsure whether `anchors.fill` will work, since the titleDelegate is… | |||||
That is terribly annoying... So, with a bit of knowledge about this specific pair of pages, i've switched this to using implicitWidths set to the width of the page itself, so... let's see if that works a bit better. (which, incidentally, it does here, at least... but so did the previous approach...) leinir: That is terribly annoying... So, with a bit of knowledge about this specific pair of pages… | |||||
Hmm, with the new toolbar code, there's actually little reason to use a custom delegate here, since the toolbar header already uses a title + tool buttons style. You could convert the three toolbuttons to actions and drop the rest of the delegate. ahiemstra: Hmm, with the new toolbar code, there's actually little reason to use a custom delegate here… | |||||
Ooh... you know, that's a very good idea :) It'd be even better if we could work out how to do that with the bits on the front page as well... this /is/ intended to work for convergence and whatnot - but let's poke at that after we've got this bit sorted and such :) leinir: Ooh... you know, that's a very good idea :)
It'd be even better if we could work out how to do… | |||||
95 | implicitHeight: title.height | 96 | implicitHeight: title.height | ||
96 | Kirigami.Heading { | 97 | Kirigami.Heading { | ||
97 | id: title | 98 | id: title | ||
98 | level: 1 | 99 | level: 1 | ||
99 | 100 | | |||
100 | QtLayouts.Layout.fillWidth: true; | 101 | QtLayouts.Layout.fillWidth: true; | ||
101 | QtLayouts.Layout.preferredWidth: titleTextMetrics.width | 102 | QtLayouts.Layout.preferredWidth: titleTextMetrics.width | ||
102 | QtLayouts.Layout.minimumWidth: titleTextMetrics.width | | |||
103 | opacity: component.isCurrentPage ? 1 : 0.4 | 103 | opacity: component.isCurrentPage ? 1 : 0.4 | ||
104 | maximumLineCount: 1 | 104 | maximumLineCount: 1 | ||
105 | elide: Text.ElideRight | 105 | elide: Text.ElideRight | ||
106 | text: component.title | 106 | text: component.title | ||
107 | TextMetrics { | 107 | TextMetrics { | ||
108 | id: titleTextMetrics | 108 | id: titleTextMetrics | ||
109 | text: component.title | 109 | text: component.title | ||
110 | font: title.font | 110 | font: title.font | ||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |
I don't think this works, since it's not inside another layout. Instead maybe anchors.fill: parent would work better?