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

UI/Qt: Move New Tab button in tab bar #629

Merged
merged 1 commit into from
Jul 21, 2024

Conversation

lmutter
Copy link
Contributor

@lmutter lmutter commented Jul 14, 2024

Uses the tab bar's width to determine the location of the button. The button is hidden if the window is small enough

This is in reference to #252

image
image
image
image

QToolBar with a single action is used instead of just a QToolButton, there is an issue where the button is completely black when just using a button. If that is resolved, it could be used instead.

@@ -212,6 +214,7 @@ public slots:
StringView m_webdriver_content_ipc_path;

bool m_allow_popups { false };
QToolBar* m_new_tab_button_toolbar { nullptr };
Copy link
Contributor

@circl-lastname circl-lastname Jul 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of an awkward place to put this, it is up to you, but maybe it could be closer m_zoom_menu like so?

    QMenu* m_zoom_menu { nullptr };

    QToolBar* m_new_tab_button_toolbar { nullptr };

    QMenu* m_hamburger_menu { nullptr };

Also, the button disappearing given too many tabs is a bit odd. Could the TabWidget width be limited so that it always leaves room for it? Otherwise pretty cool

@tcl3
Copy link
Contributor

tcl3 commented Jul 15, 2024

I've not investigated why this happens, but the New Tab button isn't visible when the menu bar is shown (via View -> Show Menubar).

@lmutter
Copy link
Contributor Author

lmutter commented Jul 20, 2024

Fixed the sizing so that it always makes room for the button, also fixed its position when the new menu bar is enabled

image
image
image
image

@circl-lastname
Copy link
Contributor

circl-lastname commented Jul 20, 2024

Thanks! This resolves my comment.
Also, please squash these two commits together

Copy link
Member

@ADKaster ADKaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Let's get this in tree and let folks iterate on it if there's any other edge cases.

@ADKaster ADKaster merged commit abddd0a into LadybirdBrowser:master Jul 21, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants