Skip to content

Commit 3743ff5

Browse files
committed
Set the vertical layout in .ui file instead of programatically
1 parent fe27ef8 commit 3743ff5

File tree

2 files changed

+91
-120
lines changed

2 files changed

+91
-120
lines changed

src/qt/forms/overviewpage.ui

Lines changed: 91 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>596</width>
10-
<height>342</height>
10+
<height>419</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -17,7 +17,7 @@
1717
<item>
1818
<widget class="QLabel" name="labelAlerts">
1919
<property name="visible">
20-
<bool>false</bool>
20+
<bool>true</bool>
2121
</property>
2222
<property name="styleSheet">
2323
<string notr="true">QLabel { background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #F0D0A0, stop:1 #F8D488); color:#000000; }</string>
@@ -34,7 +34,7 @@
3434
</widget>
3535
</item>
3636
<item>
37-
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1">
37+
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1">
3838
<item>
3939
<layout class="QVBoxLayout" name="verticalLayout_2">
4040
<item>
@@ -419,135 +419,111 @@
419419
</widget>
420420
</item>
421421
<item>
422-
<spacer name="verticalSpacer">
423-
<property name="orientation">
424-
<enum>Qt::Vertical</enum>
425-
</property>
426-
<property name="sizeHint" stdset="0">
427-
<size>
428-
<width>20</width>
429-
<height>40</height>
430-
</size>
431-
</property>
432-
</spacer>
433-
</item>
434-
</layout>
435-
</item>
436-
<item>
437-
<layout class="QVBoxLayout" name="verticalLayout_3">
438-
<item>
439-
<widget class="QFrame" name="frame_2">
440-
<property name="frameShape">
441-
<enum>QFrame::StyledPanel</enum>
442-
</property>
443-
<property name="frameShadow">
444-
<enum>QFrame::Raised</enum>
445-
</property>
446-
<layout class="QVBoxLayout" name="verticalLayout">
447-
<item>
448-
<layout class="QHBoxLayout" name="horizontalLayout_2">
422+
<layout class="QVBoxLayout" name="verticalLayout_3">
423+
<item>
424+
<widget class="QFrame" name="frame_2">
425+
<property name="frameShape">
426+
<enum>QFrame::StyledPanel</enum>
427+
</property>
428+
<property name="frameShadow">
429+
<enum>QFrame::Raised</enum>
430+
</property>
431+
<layout class="QVBoxLayout" name="verticalLayout">
449432
<item>
450-
<widget class="QLabel" name="label_4">
451-
<property name="font">
452-
<font>
453-
<weight>75</weight>
454-
<bold>true</bold>
455-
</font>
456-
</property>
457-
<property name="text">
458-
<string>Recent transactions</string>
459-
</property>
460-
</widget>
433+
<layout class="QHBoxLayout" name="horizontalLayout_2">
434+
<item>
435+
<widget class="QLabel" name="label_4">
436+
<property name="font">
437+
<font>
438+
<weight>75</weight>
439+
<bold>true</bold>
440+
</font>
441+
</property>
442+
<property name="text">
443+
<string>Recent transactions</string>
444+
</property>
445+
</widget>
446+
</item>
447+
<item>
448+
<widget class="QPushButton" name="labelTransactionsStatus">
449+
<property name="enabled">
450+
<bool>true</bool>
451+
</property>
452+
<property name="maximumSize">
453+
<size>
454+
<width>30</width>
455+
<height>16777215</height>
456+
</size>
457+
</property>
458+
<property name="toolTip">
459+
<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>
460+
</property>
461+
<property name="text">
462+
<string/>
463+
</property>
464+
<property name="icon">
465+
<iconset resource="../bitcoin.qrc">
466+
<normaloff>:/icons/warning</normaloff>
467+
<disabledoff>:/icons/warning</disabledoff>:/icons/warning</iconset>
468+
</property>
469+
<property name="iconSize">
470+
<size>
471+
<width>24</width>
472+
<height>24</height>
473+
</size>
474+
</property>
475+
<property name="flat">
476+
<bool>true</bool>
477+
</property>
478+
</widget>
479+
</item>
480+
<item>
481+
<spacer name="horizontalSpacer">
482+
<property name="orientation">
483+
<enum>Qt::Horizontal</enum>
484+
</property>
485+
<property name="sizeHint" stdset="0">
486+
<size>
487+
<width>40</width>
488+
<height>20</height>
489+
</size>
490+
</property>
491+
</spacer>
492+
</item>
493+
</layout>
461494
</item>
462495
<item>
463-
<widget class="QPushButton" name="labelTransactionsStatus">
464-
<property name="enabled">
465-
<bool>true</bool>
466-
</property>
467-
<property name="maximumSize">
468-
<size>
469-
<width>30</width>
470-
<height>16777215</height>
471-
</size>
496+
<widget class="QListView" name="listTransactions">
497+
<property name="styleSheet">
498+
<string notr="true">QListView { background: transparent; }</string>
472499
</property>
473-
<property name="toolTip">
474-
<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>
475-
</property>
476-
<property name="text">
477-
<string/>
500+
<property name="frameShape">
501+
<enum>QFrame::NoFrame</enum>
478502
</property>
479-
<property name="icon">
480-
<iconset resource="../bitcoin.qrc">
481-
<normaloff>:/icons/warning</normaloff>
482-
<disabledoff>:/icons/warning</disabledoff>:/icons/warning</iconset>
503+
<property name="verticalScrollBarPolicy">
504+
<enum>Qt::ScrollBarAlwaysOff</enum>
483505
</property>
484-
<property name="iconSize">
485-
<size>
486-
<width>24</width>
487-
<height>24</height>
488-
</size>
506+
<property name="horizontalScrollBarPolicy">
507+
<enum>Qt::ScrollBarAlwaysOff</enum>
489508
</property>
490-
<property name="flat">
491-
<bool>true</bool>
509+
<property name="selectionMode">
510+
<enum>QAbstractItemView::NoSelection</enum>
492511
</property>
493512
</widget>
494513
</item>
495-
<item>
496-
<spacer name="horizontalSpacer">
497-
<property name="orientation">
498-
<enum>Qt::Horizontal</enum>
499-
</property>
500-
<property name="sizeHint" stdset="0">
501-
<size>
502-
<width>40</width>
503-
<height>20</height>
504-
</size>
505-
</property>
506-
</spacer>
507-
</item>
508514
</layout>
509-
</item>
510-
<item>
511-
<widget class="QListView" name="listTransactions">
512-
<property name="styleSheet">
513-
<string notr="true">QListView { background: transparent; }</string>
514-
</property>
515-
<property name="frameShape">
516-
<enum>QFrame::NoFrame</enum>
517-
</property>
518-
<property name="verticalScrollBarPolicy">
519-
<enum>Qt::ScrollBarAlwaysOff</enum>
520-
</property>
521-
<property name="horizontalScrollBarPolicy">
522-
<enum>Qt::ScrollBarAlwaysOff</enum>
523-
</property>
524-
<property name="selectionMode">
525-
<enum>QAbstractItemView::NoSelection</enum>
526-
</property>
527-
</widget>
528-
</item>
529-
</layout>
530-
</widget>
531-
</item>
532-
<item>
533-
<spacer name="verticalSpacer_2">
534-
<property name="orientation">
535-
<enum>Qt::Vertical</enum>
536-
</property>
537-
<property name="sizeHint" stdset="0">
538-
<size>
539-
<width>20</width>
540-
<height>40</height>
541-
</size>
542-
</property>
543-
</spacer>
515+
</widget>
516+
</item>
517+
</layout>
544518
</item>
545519
</layout>
546520
</item>
547521
</layout>
548522
</item>
549523
</layout>
550524
</widget>
551-
<resources/>
525+
<resources>
526+
<include location="../bitcoin.qrc"/>
527+
</resources>
552528
<connections/>
553529
</ui>

src/qt/overviewpage.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
119119

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

122-
// Move the "Recent Transactions" view below "Balances"
123-
ui->verticalLayout_3->removeWidget(ui->frame_2);
124-
ui->verticalLayout_2->addWidget(ui->frame_2);
125-
ui->horizontalLayout->removeItem(ui->verticalLayout_3);
126-
127122
// use a SingleColorIcon for the "out of sync warning" icon
128123
QIcon icon = platformStyle->SingleColorIcon(":/icons/warning");
129124
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)

0 commit comments

Comments
 (0)