Remove useless spaces, set default to minimalist and use Screen pixel depth definition instead of forcing max size.

Add a collapse/expand button for main menu.
This commit is contained in:
Julien Wadel 2026-04-02 17:31:47 +02:00
parent 2123c573fa
commit 72e2332711
6 changed files with 82 additions and 26 deletions

View file

@ -14,6 +14,7 @@ Item {
id: mainItem
property var callObj
property var contextualMenuOpenedComponent: undefined
property bool showLeftMenu: true
signal addAccountRequest
signal openNewCallRequest
@ -121,12 +122,12 @@ Item {
RowLayout {
anchors.fill: parent
spacing: 0
anchors.topMargin: Utils.getSizeWithScreenRatio(25)
anchors.topMargin: Utils.getSizeWithScreenRatio(0)
VerticalTabBar {
id: tabbar
Layout.fillHeight: true
Layout.preferredWidth: Utils.getSizeWithScreenRatio(82)
Layout.preferredWidth: visible ? Utils.getSizeWithScreenRatio(82) : 0
visible: mainItem.showLeftMenu
defaultAccount: accountProxy.defaultAccount
currentIndex: 0
onCountChanged: if (currentIndex >= count) currentIndex = 0
@ -210,9 +211,45 @@ Item {
RowLayout {
id: topRow
Layout.preferredHeight: Utils.getSizeWithScreenRatio(50)
Layout.leftMargin: Utils.getSizeWithScreenRatio(45)
Layout.rightMargin: Utils.getSizeWithScreenRatio(41)
Layout.leftMargin: Utils.getSizeWithScreenRatio(0)
Layout.rightMargin: Utils.getSizeWithScreenRatio(0)
spacing: Utils.getSizeWithScreenRatio(25)
Item {
Layout.preferredHeight: parent.height
Layout.preferredWidth: Utils.getSizeWithScreenRatio(82)
visible: !mainItem.showLeftMenu
Rectangle {
anchors.fill: parent
color: DefaultStyle.main1_500_main
radius: Utils.getSizeWithScreenRatio(25)
}
Rectangle {
color: DefaultStyle.main1_500_main
anchors.left: parent.left
anchors.top: parent.top
width: parent.width / 2
height: parent.height / 2
}
Rectangle {
color: DefaultStyle.main1_500_main
y: parent.y + parent.height / 2
width: parent.width
height: parent.height / 2
}
EffectImage {
anchors.centerIn: parent
height: Utils.getSizeWithScreenRatio(24)
width: Utils.getSizeWithScreenRatio(24)
imageSource: AppIcons.layout
fillMode: Image.PreserveAspectFit
colorizationColor: DefaultStyle.grey_0
useColor: true
MouseArea {
anchors.fill: parent
onClicked: mainItem.showLeftMenu = !mainItem.showLeftMenu
}
}
}
SearchBar {
id: magicSearchBar
Layout.fillWidth: true
@ -728,12 +765,29 @@ Item {
pushExit: noTransition
popEnter: noTransition
popExit: noTransition
Layout.topMargin: Utils.getSizeWithScreenRatio(24)
Layout.topMargin: Utils.getSizeWithScreenRatio(0)
Layout.fillWidth: true
Layout.fillHeight: true
initialItem: mainStackLayoutComponent
}
}
}
EffectImage {
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: Utils.getSizeWithScreenRatio(82-24)/2
anchors.topMargin: Utils.getSizeWithScreenRatio(8)
height: Utils.getSizeWithScreenRatio(24)
width: Utils.getSizeWithScreenRatio(24)
visible: mainItem.showLeftMenu
imageSource: AppIcons.layout
fillMode: Image.PreserveAspectFit
colorizationColor: DefaultStyle.grey_0
useColor: true
MouseArea{
anchors.fill: parent
onClicked: mainItem.showLeftMenu = !mainItem.showLeftMenu
}
}
}
}

View file

@ -28,7 +28,7 @@ FocusScope {
Control.SplitView {
id: splitView
anchors.fill: parent
anchors.topMargin: Utils.getSizeWithScreenRatio(10)
anchors.topMargin: Utils.getSizeWithScreenRatio(0)
handle: Rectangle {
implicitWidth: Utils.getSizeWithScreenRatio(6)

View file

@ -102,7 +102,7 @@ AbstractMainPage {
Control.StackView {
id: listStackView
anchors.fill: parent
anchors.leftMargin: Utils.getSizeWithScreenRatio(45)
anchors.leftMargin: Utils.getSizeWithScreenRatio(0)
clip: true
initialItem: historyListItem
focus: true
@ -139,12 +139,13 @@ AbstractMainPage {
RowLayout {
id: titleCallLayout
// direction: FlexboxLayout.Row
spacing: Utils.getSizeWithScreenRatio(16)
spacing: Utils.getSizeWithScreenRatio(0)
// alignItems: FlexboxLayout.AlignCenter
Layout.rightMargin: Utils.getSizeWithScreenRatio(39)
Layout.rightMargin: Utils.getSizeWithScreenRatio(0)
Layout.fillHeight: false
Text {
Layout.fillWidth: true
Layout.leftMargin: Utils.getSizeWithScreenRatio(16)
//: "Appels"
text: qsTr("call_history_call_list_title")
maximumLineCount: 1
@ -206,7 +207,7 @@ AbstractMainPage {
id: searchBar
Layout.fillWidth: true
Layout.topMargin: Utils.getSizeWithScreenRatio(18)
Layout.rightMargin: Utils.getSizeWithScreenRatio(39)
Layout.rightMargin: Utils.getSizeWithScreenRatio(16)
//: "Rechercher un appel"
placeholderText: qsTr("call_search_in_history")
visible: historyListView.count !== 0 || text.length !== 0
@ -229,8 +230,8 @@ AbstractMainPage {
visible: SettingsCpp.callForwardToAddress.length > 0
Layout.fillWidth: true
Layout.preferredHeight: Utils.getSizeWithScreenRatio(40)
Layout.topMargin: Utils.getSizeWithScreenRatio(18)
Layout.rightMargin: Utils.getSizeWithScreenRatio(39)
Layout.topMargin: Utils.getSizeWithScreenRatio(0)
Layout.rightMargin: Utils.getSizeWithScreenRatio(16)
color: "transparent"
radius: Utils.getSizeWithScreenRatio(25)
border.color: DefaultStyle.warning_500_main
@ -267,7 +268,7 @@ AbstractMainPage {
Control.Control {
id: listLayout
anchors.fill: parent
anchors.rightMargin: Utils.getSizeWithScreenRatio(39)
anchors.rightMargin: Utils.getSizeWithScreenRatio(16)
padding: 0
background: Item {}
contentItem: ColumnLayout {
@ -288,7 +289,7 @@ AbstractMainPage {
id: historyListView
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: Utils.getSizeWithScreenRatio(38)
Layout.topMargin: Utils.getSizeWithScreenRatio(0)
searchBar: searchBar
Control.ScrollBar.vertical: scrollbar

View file

@ -104,7 +104,7 @@ AbstractMainPage {
id: listStackView
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: Utils.getSizeWithScreenRatio(45)
Layout.leftMargin: Utils.getSizeWithScreenRatio(0)
clip: true
initialItem: chatListItem
focus: true
@ -124,11 +124,12 @@ AbstractMainPage {
RowLayout {
// direction: FlexboxLayout.Row
// alignItems: FlexboxLayout.AlignCenter
spacing: Utils.getSizeWithScreenRatio(16)
Layout.rightMargin: Utils.getSizeWithScreenRatio(39)
spacing: Utils.getSizeWithScreenRatio(0)
Layout.rightMargin: Utils.getSizeWithScreenRatio(0)
Layout.fillHeight: false
Text {
Layout.fillWidth: true
Layout.leftMargin: Utils.getSizeWithScreenRatio(16)
//: "Conversations"
text: qsTr("chat_list_title")
maximumLineCount: 1
@ -196,7 +197,7 @@ AbstractMainPage {
Layout.fillHeight: true
ColumnLayout {
anchors.fill: parent
anchors.rightMargin: Utils.getSizeWithScreenRatio(39)
anchors.rightMargin: Utils.getSizeWithScreenRatio(8)
Text {
visible: chatListView.count === 0 && chatListView.loading === false
Layout.alignment: Qt.AlignHCenter
@ -215,7 +216,7 @@ AbstractMainPage {
Layout.fillWidth: true
Layout.fillHeight: true
chatProxy.model: AppCpp.chats
Layout.topMargin: Utils.getSizeWithScreenRatio(39)
Layout.topMargin: Utils.getSizeWithScreenRatio(0)
searchBar: searchBar
Control.ScrollBar.vertical: scrollbar
@ -246,7 +247,7 @@ AbstractMainPage {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: Utils.getSizeWithScreenRatio(8)
anchors.rightMargin: Utils.getSizeWithScreenRatio(1)
policy: Control.ScrollBar.AsNeeded
}
}

View file

@ -13,8 +13,8 @@ ApplicationWindow {
id: mainWindow
x: 0
y: 0
width: Math.min(Utils.getSizeWithScreenRatio(1512), Screen.desktopAvailableWidth)
height: Math.min(Utils.getSizeWithScreenRatio(982), Screen.desktopAvailableHeight)
width: Math.min(Utils.getSizeWithScreenRatio(1020), Screen.desktopAvailableWidth)
height: Math.min(Utils.getSizeWithScreenRatio(700), Screen.desktopAvailableHeight)
onActiveChanged: {
if (active) UtilsCpp.setLastActiveWindow(this)

View file

@ -51,9 +51,9 @@ QtObject {
property var vue_meter_light_green: "#6FF88D"
property var vue_meter_dark_green: "#00D916"
property real defaultHeight: 1007.0
property real defaultWidth: 1512.0
property real maxDp: 0.98
property real defaultHeight: 700
property real defaultWidth: 1020
property real maxDp: Screen.pixelDensity
property real dp: Math.min((Screen.width/Screen.height)/(defaultWidth/defaultHeight), maxDp)
onDpChanged: {