mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
UI: Show "Disable" title in DevTools disable button
The "disable DevTools" button looked like a "close this notification" button to me, and although a tooltip was set, it only showed up immediately on the AppKit UI and not the Qt version. This makes the behavior of clicking the disable button a lot clearer by showing a button with "Disable" as its title.
This commit is contained in:
parent
49d2a8df23
commit
acc9499c5d
Notes:
github-actions[bot]
2025-03-20 21:45:05 +00:00
Author: https://github.com/gmta
Commit: acc9499c5d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4024
Reviewed-by: https://github.com/trflynn89 ✅
4 changed files with 6 additions and 7 deletions
|
@ -272,7 +272,7 @@
|
|||
auto message = MUST(String::formatted("DevTools is enabled on port {}", WebView::Application::browser_options().devtools_port));
|
||||
|
||||
[self.info_bar showWithMessage:Ladybird::string_to_ns_string(message)
|
||||
dismissButtonTooltip:@"Disable DevTools"
|
||||
dismissButtonTitle:@"Disable"
|
||||
dismissButtonClicked:^{
|
||||
MUST(WebView::Application::the().toggle_devtools_enabled());
|
||||
[self devtoolsDisabled];
|
||||
|
|
|
@ -15,7 +15,7 @@ using InfoBarDismissed = void (^)(void);
|
|||
@interface InfoBar : NSStackView
|
||||
|
||||
- (void)showWithMessage:(NSString*)message
|
||||
dismissButtonTooltip:(NSString*)tooltip
|
||||
dismissButtonTitle:(NSString*)title
|
||||
dismissButtonClicked:(InfoBarDismissed)on_dimissed
|
||||
activeTab:(Tab*)tab;
|
||||
- (void)hide;
|
||||
|
|
|
@ -28,7 +28,7 @@ static constexpr CGFloat const INFO_BAR_HEIGHT = 40;
|
|||
if (self = [super init]) {
|
||||
self.text_label = [NSTextField labelWithString:@""];
|
||||
|
||||
self.dismiss_button = [NSButton buttonWithImage:[NSImage imageNamed:NSImageNameStopProgressTemplate]
|
||||
self.dismiss_button = [NSButton buttonWithTitle:@""
|
||||
target:self
|
||||
action:@selector(dismiss:)];
|
||||
[self.dismiss_button setBezelStyle:NSBezelStyleAccessoryBarAction];
|
||||
|
@ -46,13 +46,13 @@ static constexpr CGFloat const INFO_BAR_HEIGHT = 40;
|
|||
}
|
||||
|
||||
- (void)showWithMessage:(NSString*)message
|
||||
dismissButtonTooltip:(NSString*)tooltip
|
||||
dismissButtonTitle:(NSString*)title
|
||||
dismissButtonClicked:(InfoBarDismissed)on_dimissed
|
||||
activeTab:(Tab*)tab
|
||||
{
|
||||
[self.text_label setStringValue:message];
|
||||
|
||||
[self.dismiss_button setToolTip:tooltip];
|
||||
self.dismiss_button.title = title;
|
||||
self.on_dimissed = on_dimissed;
|
||||
|
||||
if (tab) {
|
||||
|
|
|
@ -726,8 +726,7 @@ void BrowserWindow::devtools_disabled()
|
|||
|
||||
void BrowserWindow::devtools_enabled()
|
||||
{
|
||||
auto* disable_button = new TabBarButton(create_tvg_icon_with_theme_colors("close", palette()), this);
|
||||
disable_button->setToolTip("Disable DevTools");
|
||||
auto* disable_button = new QPushButton("Disable", this);
|
||||
|
||||
connect(disable_button, &QPushButton::clicked, this, [this]() {
|
||||
MUST(WebView::Application::the().toggle_devtools_enabled());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue