Make Jupyter Home Button beautiful

This commit is contained in:
Florian Märkl 2018-03-03 18:40:06 +01:00
parent 09a34d265e
commit 1505aefdd1
3 changed files with 9 additions and 1 deletions

4
src/img/icons/home.svg Normal file
View File

@ -0,0 +1,4 @@
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg style="enable-background:new 0 0 32 32" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" height="32px" width="32px" version="1.1" y="0px" x="0px" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32">
<path d="m16 0l-16 16h4v16h24v-16h4l-16-16zm8 28h-6v-6h-4v6h-6v-14l8-6 8 5.7v14z" fill="#4d4d4f"/>
</svg>

After

Width:  |  Height:  |  Size: 430 B

View File

@ -55,6 +55,7 @@
<file>img/icons/transfer_white.svg</file>
<file>img/icons/spin_light.svg</file>
<file>img/icons/import_light.svg</file>
<file>img/icons/home.svg</file>
<file>fonts/Anonymous Pro.ttf</file>
<file>fonts/Inconsolata-Regular.ttf</file>
<file>img/cutter_plain.svg</file>

View File

@ -26,8 +26,11 @@ JupyterWidget::JupyterWidget(QWidget *parent, Qt::WindowFlags flags) :
QWidget *cornerWidget = new QWidget(ui->tabWidget);
QHBoxLayout *cornerWidgetLayout = new QHBoxLayout(cornerWidget);
cornerWidget->setLayout(cornerWidgetLayout);
cornerWidgetLayout->setContentsMargins(4, 4, 4, 4);
homeButton = new QPushButton(cornerWidget);
homeButton->setText(tr("Home"));
homeButton->setStyleSheet("QPushButton { padding: 2px; background-color: palette(light); border-radius: 4px; }"
"QPushButton:pressed { background-color: palette(dark); }");
homeButton->setIcon(QIcon(":/img/icons/home.svg"));
homeButton->setEnabled(false);
cornerWidgetLayout->addWidget(homeButton);
ui->tabWidget->setCornerWidget(cornerWidget);