Skip to content

Commit fe9f190

Browse files
committed
make cards look sane
but it not looking good
1 parent f78dc9b commit fe9f190

File tree

7 files changed

+44
-54
lines changed

7 files changed

+44
-54
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ and trle.net part is implemented.
133133
![screenshot1](https://raw.githubusercontent.com/noisecode3/TombRaiderLinuxLauncher/main/doc/screenshot1.jpg)
134134
![screenshot1](https://raw.githubusercontent.com/noisecode3/TombRaiderLinuxLauncher/main/doc/screenshot2.jpg)
135135
![screenshot1](https://raw.githubusercontent.com/noisecode3/TombRaiderLinuxLauncher/main/doc/screenshot3.jpg)
136-
![screenshot1](https://raw.githubusercontent.com/noisecode3/TombRaiderLinuxLauncher/main/doc/screenshot4.jpg)
137136

138137
## Guide
139138

doc/screenshot1.jpg

64.3 KB
Loading

doc/screenshot2.jpg

234 KB
Loading

doc/screenshot3.jpg

395 KB
Loading

doc/screenshot4.jpg

-1.29 MB
Binary file not shown.

src/TombRaiderLinuxLauncher.ui

Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>1334</width>
10-
<height>730</height>
10+
<height>749</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -83,14 +83,14 @@
8383
</sizepolicy>
8484
</property>
8585
<property name="layoutDirection">
86-
<enum>Qt::LayoutDirection::LeftToRight</enum>
86+
<enum>Qt::LeftToRight</enum>
8787
</property>
8888
<layout class="QVBoxLayout" name="verticalLayout_11" stretch="0,0,0">
8989
<property name="spacing">
9090
<number>0</number>
9191
</property>
9292
<property name="sizeConstraint">
93-
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
93+
<enum>QLayout::SetDefaultConstraint</enum>
9494
</property>
9595
<property name="leftMargin">
9696
<number>0</number>
@@ -183,7 +183,7 @@
183183
<widget class="QLabel" name="labelClass">
184184
<property name="minimumSize">
185185
<size>
186-
<width>0</width>
186+
<width>80</width>
187187
<height>45</height>
188188
</size>
189189
</property>
@@ -394,6 +394,12 @@
394394
</item>
395395
<item>
396396
<widget class="QLabel" name="labelDifficulty">
397+
<property name="minimumSize">
398+
<size>
399+
<width>100</width>
400+
<height>45</height>
401+
</size>
402+
</property>
397403
<property name="maximumSize">
398404
<size>
399405
<width>61</width>
@@ -436,6 +442,12 @@
436442
</item>
437443
<item>
438444
<widget class="QLabel" name="labelType">
445+
<property name="minimumSize">
446+
<size>
447+
<width>80</width>
448+
<height>45</height>
449+
</size>
450+
</property>
439451
<property name="maximumSize">
440452
<size>
441453
<width>44</width>
@@ -488,6 +500,12 @@
488500
</item>
489501
<item>
490502
<widget class="QLabel" name="labelDuration">
503+
<property name="minimumSize">
504+
<size>
505+
<width>100</width>
506+
<height>45</height>
507+
</size>
508+
</property>
491509
<property name="maximumSize">
492510
<size>
493511
<width>61</width>
@@ -584,7 +602,7 @@
584602
<string>Level name</string>
585603
</property>
586604
<property name="checked">
587-
<bool>true</bool>
605+
<bool>false</bool>
588606
</property>
589607
</widget>
590608
</item>
@@ -646,6 +664,9 @@
646664
<property name="text">
647665
<string>Release Date</string>
648666
</property>
667+
<property name="checked">
668+
<bool>true</bool>
669+
</property>
649670
</widget>
650671
</item>
651672
</layout>
@@ -660,10 +681,10 @@
660681
<item>
661682
<widget class="QListView" name="listViewLevels">
662683
<property name="sizeAdjustPolicy">
663-
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustToContents</enum>
684+
<enum>QAbstractScrollArea::AdjustIgnored</enum>
664685
</property>
665686
<property name="dragDropMode">
666-
<enum>QAbstractItemView::DragDropMode::NoDragDrop</enum>
687+
<enum>QAbstractItemView::NoDragDrop</enum>
667688
</property>
668689
<property name="iconSize">
669690
<size>
@@ -672,13 +693,13 @@
672693
</size>
673694
</property>
674695
<property name="verticalScrollMode">
675-
<enum>QAbstractItemView::ScrollMode::ScrollPerPixel</enum>
696+
<enum>QAbstractItemView::ScrollPerItem</enum>
676697
</property>
677698
<property name="resizeMode">
678-
<enum>QListView::ResizeMode::Adjust</enum>
699+
<enum>QListView::Fixed</enum>
679700
</property>
680701
<property name="viewMode">
681-
<enum>QListView::ViewMode::IconMode</enum>
702+
<enum>QListView::ListMode</enum>
682703
</property>
683704
<property name="uniformItemSizes">
684705
<bool>true</bool>
@@ -693,9 +714,6 @@
693714
<verstretch>0</verstretch>
694715
</sizepolicy>
695716
</property>
696-
<property name="frameShadow">
697-
<enum>QFrame::Shadow::Plain</enum>
698-
</property>
699717
<property name="lineWidth">
700718
<number>0</number>
701719
</property>
@@ -1038,9 +1056,6 @@
10381056
</property>
10391057
<item row="0" column="0">
10401058
<widget class="QFrame" name="frameModding">
1041-
<property name="frameShadow">
1042-
<enum>QFrame::Shadow::Raised</enum>
1043-
</property>
10441059
<layout class="QVBoxLayout" name="verticalLayout_2">
10451060
<item>
10461061
<widget class="QGraphicsView" name="graphicsViewModding"/>
@@ -1077,10 +1092,7 @@
10771092
<item>
10781093
<widget class="QFrame" name="frameLevelSetup">
10791094
<property name="frameShape">
1080-
<enum>QFrame::Shape::StyledPanel</enum>
1081-
</property>
1082-
<property name="frameShadow">
1083-
<enum>QFrame::Shadow::Raised</enum>
1095+
<enum>QFrame::NoFrame</enum>
10841096
</property>
10851097
<layout class="QVBoxLayout" name="verticalLayout_13">
10861098
<item>
@@ -1099,10 +1111,7 @@
10991111
</sizepolicy>
11001112
</property>
11011113
<property name="frameShape">
1102-
<enum>QFrame::Shape::StyledPanel</enum>
1103-
</property>
1104-
<property name="frameShadow">
1105-
<enum>QFrame::Shadow::Raised</enum>
1114+
<enum>QFrame::NoFrame</enum>
11061115
</property>
11071116
<layout class="QVBoxLayout" name="verticalLayout_14">
11081117
<item>
@@ -1195,9 +1204,6 @@
11951204
</item>
11961205
<item>
11971206
<spacer name="horizontalSpacerRunnerType">
1198-
<property name="orientation">
1199-
<enum>Qt::Orientation::Horizontal</enum>
1200-
</property>
12011207
<property name="sizeHint" stdset="0">
12021208
<size>
12031209
<width>40</width>
@@ -1211,9 +1217,6 @@
12111217
</item>
12121218
<item>
12131219
<spacer name="verticalSpacerLevelSetup">
1214-
<property name="orientation">
1215-
<enum>Qt::Orientation::Vertical</enum>
1216-
</property>
12171220
<property name="sizeHint" stdset="0">
12181221
<size>
12191222
<width>20</width>
@@ -1257,10 +1260,7 @@
12571260
<item>
12581261
<widget class="QFrame" name="frameGlobalSetup">
12591262
<property name="frameShape">
1260-
<enum>QFrame::Shape::StyledPanel</enum>
1261-
</property>
1262-
<property name="frameShadow">
1263-
<enum>QFrame::Shadow::Raised</enum>
1263+
<enum>QFrame::NoFrame</enum>
12641264
</property>
12651265
<layout class="QVBoxLayout" name="verticalLayout_4">
12661266
<item>
@@ -1365,9 +1365,6 @@
13651365
</item>
13661366
<item>
13671367
<spacer name="verticalSpacerSetupLara">
1368-
<property name="orientation">
1369-
<enum>Qt::Orientation::Vertical</enum>
1370-
</property>
13711368
<property name="sizeHint" stdset="0">
13721369
<size>
13731370
<width>20</width>
@@ -1458,9 +1455,6 @@ li.checked::marker { content: &quot;\2612&quot;; }
14581455
</item>
14591456
<item>
14601457
<spacer name="verticalSpacerSetupOptions">
1461-
<property name="orientation">
1462-
<enum>Qt::Orientation::Vertical</enum>
1463-
</property>
14641458
<property name="sizeHint" stdset="0">
14651459
<size>
14661460
<width>20</width>
@@ -1498,10 +1492,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
14981492
<item row="0" column="0">
14991493
<widget class="QFrame" name="frameAbout">
15001494
<property name="frameShape">
1501-
<enum>QFrame::Shape::NoFrame</enum>
1502-
</property>
1503-
<property name="frameShadow">
1504-
<enum>QFrame::Shadow::Raised</enum>
1495+
<enum>QFrame::NoFrame</enum>
15051496
</property>
15061497
<layout class="QVBoxLayout" name="verticalLayout_5">
15071498
<item>
@@ -1513,11 +1504,8 @@ li.checked::marker { content: &quot;\2612&quot;; }
15131504
</property>
15141505
<property name="html">
15151506
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
1516-
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
1507+
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
15171508
p, li { white-space: pre-wrap; }
1518-
hr { height: 1px; border-width: 0; }
1519-
li.unchecked::marker { content: &quot;\2610&quot;; }
1520-
li.checked::marker { content: &quot;\2612&quot;; }
15211509
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:12pt; font-weight:400; font-style:normal;&quot;&gt;
15221510
&lt;h3 style=&quot; margin-top:14px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:large; font-weight:600;&quot;&gt;About&lt;/span&gt;&lt;/h3&gt;
15231511
&lt;h4 style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;Tomb Raider Linux Launcher&lt;/span&gt;&lt;/h4&gt;

src/levelViewList.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class LevelListModel : public QAbstractListModel {
3030
void setLevels() {
3131
infoList.clear();
3232
controller.getList(&infoList);
33+
sortItems(compareReleaseDates);
3334
beginResetModel();
3435
expandRange();
3536
}
@@ -171,12 +172,14 @@ class CardItemDelegate : public QStyledItemDelegate {
171172
painter->drawRoundedRect(cardRect, 10, 10);
172173

173174
// Picture space (left side)
174-
QRect imageRect = QRect(cardRect.left() + 10, cardRect.top() + 10, 80, 60);
175+
QRect imageRect = QRect(cardRect.left() + 10, cardRect.top() + 10, 320, 240);
175176
painter->setBrush(QColor("#cccccc")); // Placeholder color
176-
painter->drawRect(imageRect);
177-
QPoint coverPoint(cardRect.left() + 10, cardRect.top() + 10);
178177
QPixmap cover = index.data(Qt::UserRole + 7).value<QPixmap>();
179-
painter->drawPixmap(coverPoint, cover);
178+
if (!cover.isNull()) {
179+
painter->drawPixmap(imageRect, cover);
180+
} else {
181+
painter->drawRect(imageRect);
182+
}
180183

181184
// Text section (right side of image)
182185
int textX = imageRect.right() + 10;
@@ -205,7 +208,7 @@ class CardItemDelegate : public QStyledItemDelegate {
205208
}
206209

207210
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override {
208-
return QSize(300, 80); // Adjust size as needed
211+
return QSize(600, 300); // Adjust size as needed
209212
}
210213
};
211214

0 commit comments

Comments
 (0)