Fix expand icon size and startup highlight

Remove "hide hover highlight when keyboard pressed" feature, too hacky.
This commit is contained in:
miruka 2019-08-21 06:02:00 -04:00
parent 1f5b46c257
commit 8ef3a6dc33
8 changed files with 130 additions and 60 deletions

View File

@ -1,5 +1,4 @@
- Refactoring
- Repair timer/connection
- Repair filter members field and retest its performance
- Use HInterfaceBox for EditAccount Profile and Encryption
@ -20,7 +19,6 @@
- Fixes
- (Left?)Banner binding loop
- Reloading config files (cache)
- Tiny invisible scrollbar
- Run import in thread and AsyncClient.olm functions, they block async loop
- Handle import keys errors
@ -34,6 +32,7 @@
- Terrible performance using `QT_QPA_PLATFORM=wayland-egl`, must use `xcb`
- UI
- Make HListView scrollbars visible
- Remove first html lists left margin
- Popup:

View File

@ -1 +1,52 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"/></svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
viewBox="0 0 24 24"
version="1.1"
id="svg4"
sodipodi:docname="expand.svg"
inkscape:version="">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="640"
inkscape:window-height="480"
id="namedview6"
showgrid="false"
inkscape:zoom="9.8333333"
inkscape:cx="12"
inkscape:cy="12"
inkscape:current-layer="svg4" />
<path
d="M 6.4237288,4.7084746 8.9004169,2.2779661 18.576271,12 8.9004169,21.722034 6.4237288,19.291525 13.715254,12 Z"
id="path2"
inkscape:connector-curvature="0"
style="stroke-width:0.81016952" />
</svg>

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,13 +1,54 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created using Krita: http://krita.org -->
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:krita="http://krita.org/namespaces/svg/krita"
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="18pt"
height="18pt"
viewBox="0 0 18 18">
<defs/>
<path id="shape0" transform="matrix(0.75 0 0 0.75 3.75 0)" fill="#c8c8c8" d="M0 3L3.057 0L15 12L3.057 24L0 21L9 12Z"/>
viewBox="0 0 18 18"
version="1.1"
id="svg15"
sodipodi:docname="expand.svg"
inkscape:version="">
<metadata
id="metadata19">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="640"
inkscape:window-height="480"
id="namedview17"
showgrid="false"
inkscape:zoom="9.8333333"
inkscape:cx="-7.6779661"
inkscape:cy="12"
inkscape:current-layer="svg15" />
<defs
id="defs12" />
<path
id="shape0"
d="M 4.8940678,3.6228814 6.7204958,1.8305085 13.855932,9 6.7204958,16.169492 4.8940678,14.377119 10.271186,9 Z"
inkscape:connector-curvature="0"
style="fill:#c8c8c8;stroke-width:0.59745765" />
</svg>

Before

Width:  |  Height:  |  Size: 607 B

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -55,6 +55,7 @@ Button {
svgName: loading ? "hourglass" : iconName
Layout.fillHeight: true
Layout.alignment: Qt.AlignCenter
}
HLabel {

View File

@ -6,10 +6,10 @@ HButton {
signal activated()
signal highlightMe()
property bool isCurrent: false
property HListView view: ListView.view
property bool shouldBeCurrent: false
readonly property var delegateModel: model
@ -30,7 +30,7 @@ HButton {
HLabel {
id: title
text: "Title"
text: "Missing title"
elide: Text.ElideRight
verticalAlignment: Qt.AlignVCenter
@ -73,29 +73,22 @@ HButton {
children: [image, details].concat(additionalItems)
}
onIsCurrentChanged: if (isCurrent) highlightMe()
onHighlightMe: accountRoomList.currentIndex = model.index
onActivated: view.currentIndex = model.index
onClicked: {
ListView.highlightRangeMode = ListView.NoHighlightRange
ListView.highlightMoveDuration = 0
view.highlightRangeMode = ListView.NoHighlightRange
view.highlightMoveDuration = 0
activated()
ListView.highlightRangeMode = ListView.ApplyRange
ListView.highlightMoveDuration = theme.animationDuration
view.highlightRangeMode = ListView.ApplyRange
view.highlightMoveDuration = theme.animationDuration
}
Timer {
interval: 100
repeat: true
running: ListView.currentIndex == -1
running: view.currentIndex == -1
// Component.onCompleted won't work for this
onTriggered: if (isCurrent) highlightMe()
onTriggered: if (shouldBeCurrent) view.currentIndex = model.index
}
// Connections {
// target: ListView
// onHideHoverHighlight: tile.hovered = false
// }
}

View File

@ -7,10 +7,6 @@ HListView {
id: accountRoomList
signal hideHoverHighlight()
onHideHoverHighlight: hoverBlocker.enabled = true
readonly property var originSource: window.sidePaneModelSource
readonly property var collapseAccounts: window.uiState.collapseAccounts
readonly property string filter: paneToolBar.roomFilter
@ -62,14 +58,12 @@ HListView {
}
function previous(activate=true) {
hideHoverHighlight()
decrementCurrentIndex()
if (activate) activateLimiter.requestFire()
}
function next(activate=true) {
hideHoverHighlight()
incrementCurrentIndex()
if (activate) activateLimiter.requestFire()
}
@ -106,22 +100,14 @@ HListView {
delegate: Loader {
width: accountRoomList.width
source: "Delegate" +
(model.type == "Account" ? "Account.qml" : "Room.qml")
Component.onCompleted: setSource(
model.type == "Account" ?
"DelegateAccount.qml" : "DelegateRoom.qml",
{view: accountRoomList}
)
}
MouseArea {
id: hoverBlocker
anchors.fill: parent
enabled: false
hoverEnabled: enabled
propagateComposedEvents: true
onMouseXChanged: enabled = false
onMouseYChanged: enabled = false
}
HRateLimiter {
id: filterLimiter
cooldown: 16

View File

@ -8,11 +8,11 @@ HTileDelegate {
topPadding: model.index > 0 ? sidePane.currentSpacing / 2 : 0
bottomPadding: topPadding
backgroundColor: theme.sidePane.account.background
opacity: collapsed && ! forceExpand ?
theme.sidePane.account.collapsedOpacity : 1
isCurrent: window.uiState.page == "Pages/EditAccount/EditAccount.qml" &&
shouldBeCurrent:
window.uiState.page == "Pages/EditAccount/EditAccount.qml" &&
window.uiState.pageProperties.userId == model.data.user_id
@ -52,9 +52,8 @@ HTileDelegate {
HButton {
id: expand
iconName: "expand"
ico.dimension: 16
backgroundColor: "transparent"
leftPadding: sidePane.currentSpacing / 1.5
padding: sidePane.currentSpacing / 1.5
rightPadding: leftPadding
onClicked: accountDelegate.toggleCollapse()
@ -70,7 +69,5 @@ HTileDelegate {
}
Behavior on opacity { HNumberAnimation {} }
Layout.fillHeight: true
}
}

View File

@ -8,7 +8,9 @@ HTileDelegate {
spacing: sidePane.currentSpacing
backgroundColor: theme.sidePane.room.background
opacity: model.data.left ? theme.sidePane.room.leftRoomOpacity : 1
isCurrent: window.uiState.page == "Chat/Chat.qml" &&
shouldBeCurrent:
window.uiState.page == "Chat/Chat.qml" &&
window.uiState.pageProperties.userId == model.user_id &&
window.uiState.pageProperties.roomId == model.data.room_id