Преглед изворни кода

Merge pull request #228 from vmarkovtsev/develop

Fix launcher's UI for Ubuntu's scaled view on Retina displays
Vadim Markovtsev пре 9 година
родитељ
комит
05dff6b8e2

BIN
launcher/icons/menu-game.png


+ 16 - 1
launcher/mainwindow_moc.cpp

@@ -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()));
 }

+ 1 - 1
launcher/mainwindow_moc.h

@@ -19,7 +19,7 @@ public:
 	~MainWindow();
 
 private slots:
-	void on_startGameButon_clicked();
+	void on_startGameButton_clicked();
 
 private:
 	Ui::MainWindow *ui;

+ 2 - 2
launcher/mainwindow_moc.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/>

+ 5 - 5
launcher/modManager/cmodlistview_moc.ui

@@ -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>