mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fix launcher's UI for Ubuntu's scaled view on Retina displays
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 46 KiB | 
| @@ -33,6 +33,21 @@ MainWindow::MainWindow(const QStringList& displayList, QWidget *parent) : | ||||
| 	load(); // load FS before UI | ||||
|  | ||||
| 	ui->setupUi(this); | ||||
| 	auto width = ui->startGameTitle->fontMetrics().boundingRect(ui->startGameTitle->text()).width(); | ||||
| 	if (ui->startGameButton->iconSize().width() < width) | ||||
| 	{ | ||||
| 		ui->startGameButton->setIconSize(QSize(width, width)); | ||||
| 	} | ||||
| 	auto tab_icon_size = ui->tabSelectList->iconSize(); | ||||
| 	if (tab_icon_size.width() < width) | ||||
| 	{ | ||||
| 		ui->tabSelectList->setIconSize(QSize( | ||||
| 			width, | ||||
| 			width + tab_icon_size.height() - tab_icon_size.width())); | ||||
| 		ui->tabSelectList->setGridSize(QSize(width, width)); | ||||
| 		// 4 is a dirty hack to make it look right | ||||
| 		ui->tabSelectList->setMaximumWidth(width + 4); | ||||
| 	} | ||||
| 	ui->tabListWidget->setCurrentIndex(0); | ||||
| 	ui->settingsView->setDisplayList(displayList); | ||||
|  | ||||
| @@ -45,7 +60,7 @@ MainWindow::~MainWindow() | ||||
| 	delete ui; | ||||
| } | ||||
|  | ||||
| void MainWindow::on_startGameButon_clicked() | ||||
| void MainWindow::on_startGameButton_clicked() | ||||
| { | ||||
| 	startExecutable(pathToQString(VCMIDirs::get().clientPath())); | ||||
| } | ||||
|   | ||||
| @@ -19,7 +19,7 @@ public: | ||||
| 	~MainWindow(); | ||||
|  | ||||
| private slots: | ||||
| 	void on_startGameButon_clicked(); | ||||
| 	void on_startGameButton_clicked(); | ||||
|  | ||||
| private: | ||||
| 	Ui::MainWindow *ui; | ||||
|   | ||||
| @@ -120,7 +120,7 @@ | ||||
|      </widget> | ||||
|     </item> | ||||
|     <item row="1" column="0"> | ||||
|      <widget class="QToolButton" name="startGameButon"> | ||||
|      <widget class="QToolButton" name="startGameButton"> | ||||
|       <property name="text"> | ||||
|        <string>Play</string> | ||||
|       </property> | ||||
| @@ -199,7 +199,7 @@ | ||||
|  </customwidgets> | ||||
|  <tabstops> | ||||
|   <tabstop>tabSelectList</tabstop> | ||||
|   <tabstop>startGameButon</tabstop> | ||||
|   <tabstop>startGameButton</tabstop> | ||||
|  </tabstops> | ||||
|  <resources/> | ||||
|  <connections/> | ||||
|   | ||||
| @@ -360,7 +360,7 @@ p, li { white-space: pre-wrap; } | ||||
|        </property> | ||||
|        <property name="maximumSize"> | ||||
|         <size> | ||||
|          <width>100</width> | ||||
|          <width>220</width> | ||||
|          <height>16777215</height> | ||||
|         </size> | ||||
|        </property> | ||||
| @@ -401,7 +401,7 @@ p, li { white-space: pre-wrap; } | ||||
|        </property> | ||||
|        <property name="maximumSize"> | ||||
|         <size> | ||||
|          <width>100</width> | ||||
|          <width>140</width> | ||||
|          <height>16777215</height> | ||||
|         </size> | ||||
|        </property> | ||||
| @@ -426,7 +426,7 @@ p, li { white-space: pre-wrap; } | ||||
|        </property> | ||||
|        <property name="maximumSize"> | ||||
|         <size> | ||||
|          <width>100</width> | ||||
|          <width>140</width> | ||||
|          <height>16777215</height> | ||||
|         </size> | ||||
|        </property> | ||||
| @@ -451,7 +451,7 @@ p, li { white-space: pre-wrap; } | ||||
|        </property> | ||||
|        <property name="maximumSize"> | ||||
|         <size> | ||||
|          <width>100</width> | ||||
|          <width>140</width> | ||||
|          <height>16777215</height> | ||||
|         </size> | ||||
|        </property> | ||||
| @@ -476,7 +476,7 @@ p, li { white-space: pre-wrap; } | ||||
|        </property> | ||||
|        <property name="maximumSize"> | ||||
|         <size> | ||||
|          <width>100</width> | ||||
|          <width>140</width> | ||||
|          <height>16777215</height> | ||||
|         </size> | ||||
|        </property> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user