From fa61e8f0e3a8aa327fbeecd979ed59bcc45d3496 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 18 Jul 2019 01:18:06 -0400 Subject: [PATCH] Standard way of knowing if window "is wide" --- TODO.md | 24 +++++++++++------------ src/qml/Base/HPage.qml | 2 -- src/qml/Pages/EditAccount/EditAccount.qml | 2 +- src/qml/Pages/EditAccount/Profile.qml | 2 +- src/qml/Theme.qml | 1 + src/qml/Window.qml | 1 + 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/TODO.md b/TODO.md index 159b223a..8e525a70 100644 --- a/TODO.md +++ b/TODO.md @@ -1,18 +1,10 @@ -- Use `asyncio.as_completed()` instead of `gather` -- Resizing pane sets the autoWidthRatio -- Show sidepane when hovering on the left when collapsed/reduced -- Header back button -- Standardize "wide: width > 414..." -- Way to round avatar corners to allow box radius +- HTextField focus effect - Devices and client settings in edit account page - If avatar is set, name color from average color? -- Wrong avatar for group rooms - Reduce messages ListView cacheBuffer height once http thumbnails downloading is implemented -- HTextField focus effect - Button can get "hoverEnabled: false" to let HoverHandlers work - Handle thumbnail response status 400 -- "Loading..." if going to edit account page while it's loading - Improve avatar tooltips position, add stuff to room tooltips (last msg?) - Accept drag and dropping a picture in account settings to set avatar - When all the events loaded on beginning in a room are name/avatar changes, @@ -26,8 +18,10 @@ - Refactoring - Don't bake in size properties for components - Unfinished work in button-refactor branch + - Room Sidepane - Bug fixes + - Wrong avatar for group rooms - Past events loading (limit 100) freezes the GUI - need to move upsert func to a WorkerScript - `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function` @@ -37,10 +31,15 @@ - "Rejoin" LeftBanner button if room is public - Daybreak color - Html links color - - `pyotherside.atexit()` - - Way to put sidepane back to auto-sizing (snap) - - Better look for arrows and option button when sidepane collapsed - Don't put own messages to the right past certain width + - `pyotherside.atexit()` + - Sidepane + - Header back button when reduced + - Better look for arrows and option button when collapsed + - Way to put it back to auto-sizing (snap) + - Show it when hovering on the left when collapsed/reduced + - Ability to drag on any place of the pane to resize + - Reducable room sidepane, swipe to show full-window - Invite to room - Server selection @@ -58,6 +57,7 @@ - Message/text selection - Custom file picker for Linux... + - Way to round avatar corners to allow box radius - Major features - E2E diff --git a/src/qml/Base/HPage.qml b/src/qml/Base/HPage.qml index d3a4103a..121a169b 100644 --- a/src/qml/Base/HPage.qml +++ b/src/qml/Base/HPage.qml @@ -16,8 +16,6 @@ SwipeView { property alias headerLabel: innerHeaderLabel property var hideHeaderUnderHeight: null - property bool wide: width > 414 + leftPadding + rightPadding - property int currentSpacing: Math.min(theme.spacing * width / 400, theme.spacing * 2) diff --git a/src/qml/Pages/EditAccount/EditAccount.qml b/src/qml/Pages/EditAccount/EditAccount.qml index 74a1a39e..6b2b7e7a 100644 --- a/src/qml/Pages/EditAccount/EditAccount.qml +++ b/src/qml/Pages/EditAccount/EditAccount.qml @@ -26,7 +26,7 @@ HPage { Layout.maximumWidth: Math.min(parent.width, 640) Layout.preferredWidth: - wide ? parent.width : avatarPreferredSize + window.isWide ? parent.width : avatarPreferredSize Layout.preferredHeight: childrenRect.height diff --git a/src/qml/Pages/EditAccount/Profile.qml b/src/qml/Pages/EditAccount/Profile.qml index af0da1fb..575b27db 100644 --- a/src/qml/Pages/EditAccount/Profile.qml +++ b/src/qml/Pages/EditAccount/Profile.qml @@ -33,7 +33,7 @@ HGridLayout { } columns: 2 - flow: wide ? GridLayout.LeftToRight : GridLayout.TopToBottom + flow: window.isWide ? GridLayout.LeftToRight : GridLayout.TopToBottom rowSpacing: currentSpacing Component.onCompleted: nameField.field.forceActiveFocus() diff --git a/src/qml/Theme.qml b/src/qml/Theme.qml index f1863e53..c0e24ae8 100644 --- a/src/qml/Theme.qml +++ b/src/qml/Theme.qml @@ -8,6 +8,7 @@ QtObject { property int minimumSupportedWidth: 240 property int minimumSupportedHeight: 120 + property int isWideAbove: 599 property int minimumSupportedWidthPlusSpacing: 240 + spacing * 2 property int minimumSupportedHeightPlusSpacing: 120 + spacing * 2 diff --git a/src/qml/Window.qml b/src/qml/Window.qml index 86af2ca1..c29ab563 100644 --- a/src/qml/Window.qml +++ b/src/qml/Window.qml @@ -18,6 +18,7 @@ ApplicationWindow { property bool debug: false property bool ready: false + property bool isWide: width > theme.isWideAbove Component.onCompleted: { Qt.application.organization = "harmonyqml"