mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-24 06:25:01 -04:00
TabLabel sets its own tooltip so all tabs have a tooltip rather than just devices
This commit is contained in:
@@ -1021,7 +1021,6 @@ void OpenRGBDialog::UpdateDevicesList()
|
||||
TabLabel* NewTabLabel = new TabLabel(OpenRGBFont::GetIconIDFromDeviceType(controllers[controller_idx]->GetDeviceType()), (char *)controllers[controller_idx]->GetName().c_str(), (char *)context, false);
|
||||
|
||||
ui->DevicesTabBar->tabBar()->setTabButton(ui->DevicesTabBar->count() - 1, QTabBar::LeftSide, NewTabLabel);
|
||||
ui->DevicesTabBar->tabBar()->setTabToolTip(ui->DevicesTabBar->count() - 1, QString::fromStdString(controllers[controller_idx]->GetName()));
|
||||
|
||||
/*---------------------------------*\
|
||||
| Now move the new tab to the |
|
||||
@@ -1089,7 +1088,6 @@ void OpenRGBDialog::UpdateDevicesList()
|
||||
TabLabel* NewTabLabel = new TabLabel(OpenRGBFont::GetIconIDFromDeviceType(controllers[controller_idx]->GetDeviceType()), (char *)controllers[controller_idx]->GetName().c_str(), (char *)context, false);
|
||||
|
||||
ui->DevicesTabBar->tabBar()->setTabButton(ui->DevicesTabBar->count() - 1, QTabBar::LeftSide, NewTabLabel);
|
||||
ui->DevicesTabBar->tabBar()->setTabToolTip(ui->DevicesTabBar->count() - 1, QString::fromStdString(controllers[controller_idx]->GetName()));
|
||||
|
||||
/*-----------------------------------------*\
|
||||
| Now move the new tab to the correct |
|
||||
|
||||
@@ -92,6 +92,7 @@ void TabLabel::UpdateLabel(bool in_constructor)
|
||||
\*-------------------------------------------------*/
|
||||
QApplication* app = static_cast<QApplication *>(QApplication::instance());
|
||||
ui->name->setText(app->translate(context, label));
|
||||
setToolTip(app->translate(context, label));
|
||||
}
|
||||
else if(in_constructor)
|
||||
{
|
||||
@@ -100,5 +101,6 @@ void TabLabel::UpdateLabel(bool in_constructor)
|
||||
| translatable as label buffer may not exist |
|
||||
\*-------------------------------------------------*/
|
||||
ui->name->setText(label);
|
||||
setToolTip(label);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user