Tracker: File panel misc style fixes

Change-Id: I6376e52d26ac05e0f591c2484a7c7301cee6166b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9523
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
This commit is contained in:
John Scipione
2025-07-28 12:34:49 +00:00
parent 24f4871106
commit abc4a28949
+28 -29
View File
@@ -1163,44 +1163,43 @@ TFilePanel::SetButtonLabel(file_panel_button selector, const char* text)
{
switch (selector) {
case B_CANCEL_BUTTON:
{
BButton* button
= dynamic_cast<BButton*>(FindView("cancel button"));
if (button == NULL)
break;
{
BButton* button = dynamic_cast<BButton*>(FindView("cancel button"));
if (button == NULL)
break;
float old_width = button->StringWidth(button->Label());
button->SetLabel(text);
float delta = old_width - button->StringWidth(text);
if (delta) {
button->MoveBy(delta, 0);
button->ResizeBy(-delta, 0);
}
break;
}
case B_DEFAULT_BUTTON:
{
fButtonText = text;
float delta = 0;
BButton* button = dynamic_cast<BButton*>(FindView("default button"));
if (button != NULL) {
float old_width = button->StringWidth(button->Label());
button->SetLabel(text);
float delta = old_width - button->StringWidth(text);
delta = old_width - button->StringWidth(text);
if (delta) {
button->MoveBy(delta, 0);
button->ResizeBy(-delta, 0);
}
}
break;
case B_DEFAULT_BUTTON:
{
fButtonText = text;
float delta = 0;
BButton* button
= dynamic_cast<BButton*>(FindView("default button"));
if (button != NULL) {
float old_width = button->StringWidth(button->Label());
button->SetLabel(text);
delta = old_width - button->StringWidth(text);
if (delta) {
button->MoveBy(delta, 0);
button->ResizeBy(-delta, 0);
}
}
// now must move cancel button
button = dynamic_cast<BButton*>(FindView("cancel button"));
if (button != NULL)
button->MoveBy(delta, 0);
// now must move cancel button
button = dynamic_cast<BButton*>(FindView("cancel button"));
if (button != NULL)
button->MoveBy(delta, 0);
}
break;
}
}
}
@@ -1211,8 +1210,7 @@ TFilePanel::SetSaveText(const char* text)
if (text == NULL)
return;
BTextControl* textControl
= dynamic_cast<BTextControl*>(FindView("text view"));
BTextControl* textControl = dynamic_cast<BTextControl*>(FindView("text view"));
if (textControl != NULL) {
textControl->SetText(text);
if (textControl->TextView() != NULL)
@@ -1410,6 +1408,7 @@ TFilePanel::MessageReceived(BMessage* message)
HandleSaveButton();
} else
HandleOpenButton();
break;
case B_OBSERVER_NOTICE_CHANGE: