Commit Graph

6 Commits

Author SHA1 Message Date
Sam Atkins
06484d0663 UI/Qt: Manually paint the tab-bar background where the "add" button was
The TabBar itself does not stretch the entire width of the TabWidget,
because it leaves space for the width of the new-tab button. So, we
manually tell Qt to paint the TabBar's background into the gap.

Fixes #768.
2024-07-29 12:02:02 +02:00
Sam Atkins
e17362ab79 UI/Qt: Make TabWidget responsible for new-tab button positioning
Makes use of the fact that QTabWidget automatically reserves space
for "corner widgets", and gives us the ability to override their
location with a custom style.

Also, determine the height of the new-tab button using the height of the
tab bar, instead of a hard-coded 32px which was too tall on MacOS.
2024-07-29 12:02:02 +02:00
Daniel Bertalan
c62240aa80 Everywhere: Warn on function definitions without prototypes
If no header includes the prototype of a function, then it cannot be
used from outside the translation unit it was defined in. In that case,
it should be marked as `static`, in order to avoid possible ODR
problems, unnecessary exported symbols, and allow the compiler to better
optimize those.

If this warning triggers in a function defined in a header, `inline`
needs to be added, otherwise if the header is included in more than one
TU, it will fail to link with a duplicate definition error.

The reason this diff got so big is that Lagom-only code wasn't built
with this flag even in Serenity times.
2024-07-17 21:51:29 +02:00
Jamie Mansfield
17fc995ee4 Ladybird: Add a context menu to the tab bar
This shows the following actions:

* Reload Tab
* Duplicate Tab
* Move Tab
  * Move to Start
  * Move to End
* Close Tab
* Close Other Tabs
  * Close Tabs to Left
  * Close Tabs to Right
  * Close Other Tabs
2024-04-29 08:11:21 +02:00
Timothy Flynn
2713d4651d Ladybird/Qt: Specify a minimum and maxium tab width
By default, Qt will grow the width of a tab button to fit the title text
of the tab. For long titles or file:// URLs, this looks rather bad. This
sets a min/max tab width to prevent such infinite growth.

To do this, we have to subclass both QTabWidget and QTabBar, because the
functions to be called/overridden are protected.
2024-04-03 20:56:04 +02:00
Timothy Flynn
1fc995d4aa Ladybird/Qt: Add a hover effect to the audio play state button
By default, a flat QPushButton does not have a hover effect. Add a small
subclass to provide such an effect to make it clearer it is a button.
2024-04-03 20:56:04 +02:00