Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window resize changes size of navigation sidebar #10613

Open
asdkant opened this issue Apr 21, 2024 · 3 comments · May be fixed by #10641
Open

Window resize changes size of navigation sidebar #10613

asdkant opened this issue Apr 21, 2024 · 3 comments · May be fixed by #10641

Comments

@asdkant
Copy link

asdkant commented Apr 21, 2024

Overview

When I resize the application's window, the size of the navigation sidebar on the left (the one showing the DB's folders) changes size proportional to the window. This may be done as a naive approach, but it's not good from a usability standpoint because what usually changes is the content on the main list (on the right side)

Steps to Reproduce

  1. Open a database
  2. resize the window horizontally

Expected Behavior

The horizontal size of the left sidebar shoul stay constant

Actual Behavior

The horizontal size of the left sidebar changes proportional to the window.
Take for example GIMP or Dolphin: in both, if you resize the window the toolbars on the sides are not resized.

Context

See how when I resize the window the sidebar absolute size changes and longer folder names get truncated:
image

KeePassXC - Version 2.7.7
Revision: 68e2dd8

Operating System: Linux
Desktop Env: KDE (Plasma 6.0.4, KDE Framework 6.1.0, QA 6.7)
Windowing System: Wayland

@asdkant asdkant added the bug label Apr 21, 2024
@droidmonkey
Copy link
Member

Related to this one I just closed in favor of your report: #6152

This is a known frustration and I agree needs to be corrected.

@droidmonkey droidmonkey added this to the v2.8.0 milestone Apr 21, 2024
0xdeadbeer added a commit to 0xdeadbeer/keepassxc that referenced this issue Apr 29, 2024
@0xdeadbeer
Copy link
Contributor

Commit changes:

diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp
index e38b943a..c4e24a34 100644
--- a/src/gui/DatabaseWidget.cpp
+++ b/src/gui/DatabaseWidget.cpp
@@ -138,8 +138,9 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
     m_mainSplitter->setChildrenCollapsible(true);
     m_mainSplitter->addWidget(m_groupSplitter);
     m_mainSplitter->addWidget(rightHandSideWidget);
-    m_mainSplitter->setStretchFactor(0, 30);
-    m_mainSplitter->setStretchFactor(1, 70);
+    m_mainSplitter->setStretchFactor(0, 0);
+    m_mainSplitter->setStretchFactor(1, 100);
+    m_mainSplitter->setSizes({1, 1});
 
     m_previewSplitter->setOrientation(Qt::Vertical);
     m_previewSplitter->setChildrenCollapsible(true);

Tried to correct this behaviour by taking example from the preview splitter (since it looks to have the desired behaviour). Seems good to me now, thoughts?

@0xdeadbeer
Copy link
Contributor

I noticed similar behaviour with the tagsWidget when changing window's height. Perhaps we could fix that as well with a similar change..?

diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp
index c4e24a34..5ef1549d 100644
--- a/src/gui/DatabaseWidget.cpp
+++ b/src/gui/DatabaseWidget.cpp
@@ -121,8 +121,9 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
     m_groupSplitter->setChildrenCollapsible(true);
     m_groupSplitter->addWidget(m_groupView);
     m_groupSplitter->addWidget(tagsWidget);
-    m_groupSplitter->setStretchFactor(0, 70);
-    m_groupSplitter->setStretchFactor(1, 30);
+    m_groupSplitter->setStretchFactor(0, 100);
+    m_groupSplitter->setStretchFactor(1, 0);
+    m_groupSplitter->setSizes({1,1});
 
     auto rightHandSideWidget = new QWidget(m_mainSplitter);
     auto rightHandSideVBox = new QVBoxLayout();

0xdeadbeer added a commit to 0xdeadbeer/keepassxc that referenced this issue Apr 29, 2024
@0xdeadbeer 0xdeadbeer linked a pull request Apr 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants