mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-31 20:41:45 +01:00
Qt: toolbar adjustments
This commit is contained in:
parent
4db79c458d
commit
cb3933dcab
@ -80,25 +80,35 @@ void main_window::Init()
|
||||
// hide utilities from the average user
|
||||
ui->menuUtilities->menuAction()->setVisible(guiSettings->GetValue(gui::m_showDebugTab).toBool());
|
||||
|
||||
// for highdpi resize toolbar icons and height dynamically
|
||||
// choose factors to mimic Gui-Design in main_window.ui
|
||||
// TODO: delete this in case Qt::AA_EnableHighDpiScaling is enabled in main.cpp
|
||||
#ifdef _WIN32
|
||||
const int toolIconHeight = menuBar()->sizeHint().height() * 1.5;
|
||||
ui->toolBar->setIconSize(QSize(toolIconHeight, toolIconHeight));
|
||||
#endif
|
||||
|
||||
const int toolBarHeight = ui->toolBar->sizeHint().height();
|
||||
|
||||
// resize toolbar actions
|
||||
for (const auto& act : ui->toolBar->actions())
|
||||
{
|
||||
if (act->isSeparator())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ui->toolBar->widgetForAction(act)->setMinimumWidth(toolBarHeight);
|
||||
}
|
||||
|
||||
ui->sizeSliderContainer->setFixedWidth(toolBarHeight * 5);
|
||||
|
||||
// add toolbar widgets (crappy Qt designer is not able to)
|
||||
ui->toolBar->setObjectName("mw_toolbar");
|
||||
ui->sizeSlider->setRange(0, gui::gl_max_slider_pos);
|
||||
ui->toolBar->addWidget(ui->sizeSliderContainer);
|
||||
ui->toolBar->addSeparator();
|
||||
ui->toolBar->addWidget(ui->mw_searchbar);
|
||||
|
||||
// for highdpi resize toolbar icons and height dynamically
|
||||
// choose factors to mimic Gui-Design in main_window.ui
|
||||
// TODO: in case Qt::AA_EnableHighDpiScaling is enabled in main.cpp we only need the else branch
|
||||
#ifdef _WIN32
|
||||
const int toolBarHeight = menuBar()->sizeHint().height() * 1.5;
|
||||
ui->toolBar->setIconSize(QSize(toolBarHeight, toolBarHeight));
|
||||
#else
|
||||
const int toolBarHeight = ui->toolBar->iconSize().height();
|
||||
#endif
|
||||
ui->sizeSliderContainer->setFixedWidth(toolBarHeight * 5);
|
||||
ui->sizeSlider->setFixedHeight(toolBarHeight * 0.65f);
|
||||
|
||||
CreateActions();
|
||||
CreateDockWindows();
|
||||
CreateConnects();
|
||||
@ -779,6 +789,7 @@ void main_window::OnEmuRun()
|
||||
ui->sysPauseAct->setText(tr("&Pause\tCtrl+P"));
|
||||
ui->sysPauseAct->setIcon(m_icon_pause);
|
||||
ui->toolbar_start->setIcon(m_icon_pause);
|
||||
ui->toolbar_start->setText(tr("Pause"));
|
||||
ui->toolbar_start->setToolTip(tr("Pause emulation"));
|
||||
EnableMenus(true);
|
||||
|
||||
@ -800,6 +811,7 @@ void main_window::OnEmuResume()
|
||||
ui->sysPauseAct->setText(tr("&Pause\tCtrl+P"));
|
||||
ui->sysPauseAct->setIcon(m_icon_pause);
|
||||
ui->toolbar_start->setIcon(m_icon_pause);
|
||||
ui->toolbar_start->setText(tr("Pause"));
|
||||
ui->toolbar_start->setToolTip(tr("Pause emulation"));
|
||||
}
|
||||
|
||||
@ -812,6 +824,7 @@ void main_window::OnEmuPause()
|
||||
ui->sysPauseAct->setText(tr("&Resume\tCtrl+E"));
|
||||
ui->sysPauseAct->setIcon(m_icon_play);
|
||||
ui->toolbar_start->setIcon(m_icon_play);
|
||||
ui->toolbar_start->setText(tr("Play"));
|
||||
ui->toolbar_start->setToolTip(tr("Resume emulation"));
|
||||
}
|
||||
|
||||
@ -831,6 +844,7 @@ void main_window::OnEmuStop()
|
||||
{
|
||||
ui->toolbar_start->setEnabled(true);
|
||||
ui->toolbar_start->setIcon(m_icon_restart);
|
||||
ui->toolbar_start->setText(tr("Restart"));
|
||||
ui->toolbar_start->setToolTip(tr("Restart emulation"));
|
||||
ui->sysRebootAct->setEnabled(true);
|
||||
#ifdef _WIN32
|
||||
@ -840,6 +854,7 @@ void main_window::OnEmuStop()
|
||||
else
|
||||
{
|
||||
ui->toolbar_start->setIcon(m_icon_play);
|
||||
ui->toolbar_start->setText(tr("Play"));
|
||||
ui->toolbar_start->setToolTip(Emu.IsReady() ? tr("Start emulation") : tr("Resume emulation"));
|
||||
}
|
||||
#ifdef WITH_DISCORD_RPC
|
||||
@ -861,6 +876,7 @@ void main_window::OnEmuReady()
|
||||
ui->sysPauseAct->setText(Emu.IsReady() ? tr("&Start\tCtrl+E") : tr("&Resume\tCtrl+E"));
|
||||
ui->sysPauseAct->setIcon(m_icon_play);
|
||||
ui->toolbar_start->setIcon(m_icon_play);
|
||||
ui->toolbar_start->setText(tr("Play"));
|
||||
ui->toolbar_start->setToolTip(Emu.IsReady() ? tr("Start emulation") : tr("Resume emulation"));
|
||||
EnableMenus(true);
|
||||
}
|
||||
|
@ -85,11 +85,11 @@
|
||||
<x>280</x>
|
||||
<y>10</y>
|
||||
<width>181</width>
|
||||
<height>21</height>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -141,7 +141,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1058</width>
|
||||
<height>26</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
@ -313,7 +313,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonIconOnly</enum>
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
<property name="floatable">
|
||||
<bool>false</bool>
|
||||
@ -325,20 +325,16 @@
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="toolbar_disc"/>
|
||||
<addaction name="toolbar_refresh"/>
|
||||
<addaction name="toolbar_fullscreen"/>
|
||||
<addaction name="toolbar_snap"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="toolbar_stop"/>
|
||||
<addaction name="toolbar_start"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="toolbar_controls"/>
|
||||
<addaction name="toolbar_config"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="toolbar_refresh"/>
|
||||
<addaction name="toolbar_controls"/>
|
||||
<addaction name="toolbar_list"/>
|
||||
<addaction name="toolbar_grid"/>
|
||||
<addaction name="toolbar_sort"/>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<action name="bootElfAct">
|
||||
<property name="text">
|
||||
@ -779,7 +775,7 @@
|
||||
<normaloff>:/Icons/pause.png</normaloff>:/Icons/pause.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>start</string>
|
||||
<string>Start</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pause emulation</string>
|
||||
@ -791,7 +787,7 @@
|
||||
<normaloff>:/Icons/stop.png</normaloff>:/Icons/stop.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>stop</string>
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Stop emulation</string>
|
||||
@ -803,7 +799,7 @@
|
||||
<normaloff>:/Icons/configure.png</normaloff>:/Icons/configure.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>config</string>
|
||||
<string>Config</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Configuration</string>
|
||||
@ -815,10 +811,7 @@
|
||||
<normaloff>:/Icons/controls.png</normaloff>:/Icons/controls.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Controls</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Controls</string>
|
||||
<string>Pads</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Configure controls</string>
|
||||
@ -851,7 +844,7 @@
|
||||
<normaloff>:/Icons/fullscreen.png</normaloff>:/Icons/fullscreen.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>fullscreen</string>
|
||||
<string>FullScr</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Toggle fullscreen</string>
|
||||
@ -863,7 +856,7 @@
|
||||
<normaloff>:/Icons/list.png</normaloff>:/Icons/list.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>list</string>
|
||||
<string>List</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Switch to list mode</string>
|
||||
@ -875,7 +868,7 @@
|
||||
<normaloff>:/Icons/grid.png</normaloff>:/Icons/grid.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>grid</string>
|
||||
<string>Grid</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Switch to grid mode</string>
|
||||
@ -908,7 +901,7 @@
|
||||
<normaloff>:/Icons/refresh.png</normaloff>:/Icons/refresh.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>refresh</string>
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Refresh gamelist</string>
|
||||
@ -920,7 +913,7 @@
|
||||
<normaloff>:/Icons/disc.png</normaloff>:/Icons/disc.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>disc</string>
|
||||
<string>Disc</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Boot game</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user