https://bugs.kde.org/show_bug.cgi?id=416372

            Bug ID: 416372
           Summary: tab minimum width should be user-definable - with
                    workaround
           Product: Falkon
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: now...@gmail.com
          Reporter: kdeb...@insaner.com
  Target Milestone: ---

SUMMARY
The user should be able to determine the minimum width each tab can have,
instead of it being hardcoded.

STEPS TO REPRODUCE
1. Open many tabs (10+ at least)
2. Resize the width of the window, reducing until the scroll buttons on the tab
bar appears
3. You now are forced to scroll to get at tabs on each end

OBSERVED RESULT

No configuration option in preferences to define tab minimum width, so tabs are
too wide to fit in tabbar, requiring the scrollbar to appear, requiring
scrolling to get to tabs, not very pleasant when one has many tabs open in a
given window where just the page favicon would be sufficient to see.

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Falkon git master as of 2020 Jan 1
Linux Fedora Core 30 - 32bit
QtWebEngine version 5.12.5
Frameworks 5.64


ADDITIONAL INFORMATION

In src/lib/tabwidget/tabbar.cpp we can find the values (line 58):

        m_metrics[0] = 250;
        m_metrics[1] = 100;
        m_metrics[2] = 100;
        m_metrics[3] = 100;
        m_metrics[4] = -1; // Will be initialized from TabBar

defined as:

private:
    QHash<int, int> m_metrics;

and accessed with:

    int normalMaxWidth() const { return m_metrics.value(0); }
    void setNormalMaxWidth(int value) { m_metrics[0] = value; }

    int normalMinWidth() const { return m_metrics.value(1); }
    void setNormalMinWidth(int value) { m_metrics[1] = value; }

    int activeMinWidth() const { return m_metrics.value(2); }
    void setActiveMinWidth(int value) { m_metrics[2] = value; }

    int overflowedWidth() const { return m_metrics.value(3); }
    void setOverflowedWidth(int value) { m_metrics[3] = value; }

    int pinnedWidth() const { return m_metrics.value(4); }
    void setPinnedWidth(int value) { m_metrics[4] = value; }


In my opinion, using a hash is overkill, and introduces hash lookup delays when
having internal variables would do the trick perfectly, plus would massively
improve code readibility. Something like:

        m_normalMaxWidth
        m_normalMinWidth
        m_activeMinWidth
        m_overflowedWidth
        m_pinnedWidth

(I just started on kde/Qt/KF5 development, but isn't that what the Q_PROPERTY's
defined above (line 47) are supposed to do? I have not personally tested that.)

On my own tree I have just changed the hardcoded values (min normal 20, min
active 28), but it would be great if someone with the workflow for new
preferences entries could add some int entries for these. I'm guessing the best
place would be a new (third) tab on the "Tabs" preferences, and it would make
sense to have a spinner and minimum and maximum allowable entries, and probably
a trigger to not allow a higher min than max values. I unfortunately won't have
time to write the entries (I gave it a look to see how long it would take me,
and right now it's more than I can devote to this than I already have). Some of
the relevant files are:

src/lib/preferences/preferences.{h,cpp,ui}

and 

void TabBar::loadSettings()

in src/lib/tabwidget/tabbar.cpp (line 127)

not sure what else would be helpful to mention. Thank you to the brave soul who
will undertake this task.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to