Skip to content

Commit

Permalink
Set the vertical layout in .ui file instead of programatically
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 authored and stevenroose committed Nov 26, 2019
1 parent a15622a commit 921cddf
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 120 deletions.
206 changes: 91 additions & 115 deletions src/qt/forms/overviewpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>596</width>
<height>342</height>
<height>419</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="labelAlerts">
<property name="visible">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">QLabel { background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #F0D0A0, stop:1 #F8D488); color:#000000; }</string>
Expand All @@ -34,7 +34,7 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
Expand Down Expand Up @@ -419,135 +419,111 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Recent transactions</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Recent transactions</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="labelTransactionsStatus">
<property name="enabled">
<bool>true</bool>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the Liquid network after a connection is established, but this process has not completed yet.</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/warning</normaloff>
<disabledoff>:/icons/warning</disabledoff>:/icons/warning</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="labelTransactionsStatus">
<property name="enabled">
<bool>true</bool>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
<widget class="QListView" name="listTransactions">
<property name="styleSheet">
<string notr="true">QListView { background: transparent; }</string>
</property>
<property name="toolTip">
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the Liquid network after a connection is established, but this process has not completed yet.</string>
</property>
<property name="text">
<string/>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/warning</normaloff>
<disabledoff>:/icons/warning</disabledoff>:/icons/warning</iconset>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="flat">
<bool>true</bool>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QListView" name="listTransactions">
<property name="styleSheet">
<string notr="true">QListView { background: transparent; }</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../bitcoin.qrc"/>
</resources>
<connections/>
</ui>
5 changes: 0 additions & 5 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)

m_balances.balance[::policyAsset] = -1;

// Move the "Recent Transactions" view below "Balances"
ui->verticalLayout_3->removeWidget(ui->frame_2);
ui->verticalLayout_2->addWidget(ui->frame_2);
ui->horizontalLayout->removeItem(ui->verticalLayout_3);

// use a SingleColorIcon for the "out of sync warning" icon
QIcon icon = platformStyle->SingleColorIcon(":/icons/warning");
icon.addPixmap(icon.pixmap(QSize(64,64), QIcon::Normal), QIcon::Disabled); // also set the disabled icon because we are using a disabled QPushButton to work around missing HiDPI support of QLabel (https://bugreports.qt.io/browse/QTBUG-42503)
Expand Down

0 comments on commit 921cddf

Please sign in to comment.