1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +02:00

Merge pull request #228 from vmarkovtsev/develop

Fix launcher's UI for Ubuntu's scaled view on Retina displays
This commit is contained in:
Vadim Markovtsev 2016-10-02 16:29:04 +02:00 committed by GitHub
commit 05dff6b8e2
5 changed files with 24 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

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

View File

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

View File

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

View File

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