Skip to content

Commit

Permalink
fix: fix UI bugs
Browse files Browse the repository at this point in the history
  1.Adjust the minimum size to avoid overlapping space in the title bar
  2.Update the new album name copy
  3.Time Range Chinese Display Update

Log: fix UI bugs
Bug: https://pms.uniontech.com/bug-view-218997.html, https://pms.uniontech.com/bug-view-193021.html, https://pms.uniontech.com/bug-view-193009.html
  • Loading branch information
starhcq committed Jul 18, 2024
1 parent 765609c commit 1b33bff
Show file tree
Hide file tree
Showing 6 changed files with 363 additions and 272 deletions.
21 changes: 21 additions & 0 deletions src/src/albumControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2197,6 +2197,27 @@ QString AlbumControl::getFileTime(const QString &path1, const QString &path2)
auto str1 = time1.toString("yyyy/MM/dd");
auto str2 = time2.toString("yyyy/MM/dd");

QString language = QLocale::system().name();
qWarning() << "language:" << language;
if (language == "zh_CN") {
QString year = tr("Year");
QString month = tr("Month");
QString day = tr("Day");
str1 = QString("%1%2%3%4%5%6")
.arg(time1.date().year())
.arg(year)
.arg(time1.date().month())
.arg(month)
.arg(time1.date().day())
.arg(day);
str2 = QString("%1%2%3%4%5%6")
.arg(time2.date().year())
.arg(year)
.arg(time2.date().month())
.arg(month)
.arg(time2.date().day())
.arg(day);
}
if (time1 < time2) {
return str1 + "-" + str2;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/src/globalstatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "albumControl.h"

static const int sc_MinHeight = 300; // 窗口最小高度
static const int sc_MinWidth = 628; // 窗口最小宽度
static const int sc_MinWidth = 658; // 窗口最小宽度
static const int sc_MinHideHeight = 425; // 调整窗口高度小于425px时,隐藏工具栏和标题栏
static const int sc_FloatMargin = 65; // 浮动按钮边距
static const int sc_TitleHeight = 50; // 标题栏栏高度
Expand Down
79 changes: 47 additions & 32 deletions src/translations/deepin-album.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,119 +191,134 @@
<translation>Unnamed</translation>
</message>
<message>
<location filename="../src/albumControl.cpp" line="2245"/>
<location filename="../src/albumControl.cpp" line="2203"/>
<source>Year</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/albumControl.cpp" line="2204"/>
<source>Month</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/albumControl.cpp" line="2205"/>
<source>Day</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/albumControl.cpp" line="2266"/>
<source>Channel</source>
<translation>Channel</translation>
</message>
<message>
<location filename="../src/albumControl.cpp" line="2440"/>
<location filename="../src/albumControl.cpp" line="2461"/>
<source>Pictures</source>
<translation>Pictures</translation>
</message>
</context>
<context>
<name>AlbumTitle</name>
<message>
<location filename="../qml/AlbumTitle.qml" line="108"/>
<location filename="../qml/AlbumTitle.qml" line="111"/>
<source>New album</source>
<translation>New album</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="115"/>
<location filename="../qml/AlbumTitle.qml" line="118"/>
<source>Import folders</source>
<translation>Import folders</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="128"/>
<location filename="../qml/AlbumTitle.qml" line="131"/>
<source>Album</source>
<translation>Album</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="130"/>
<location filename="../qml/AlbumTitle.qml" line="133"/>
<source>Version:</source>
<translation>Version:</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="131"/>
<location filename="../qml/AlbumTitle.qml" line="134"/>
<source>Album is a stylish management tool for viewing and organizing photos and videos.</source>
<translation>Album is a stylish management tool for viewing and organizing photos and videos.</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="134"/>
<location filename="../qml/AlbumTitle.qml" line="137"/>
<source>%1 is released under %2</source>
<translation>%1 is released under %2</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="172"/>
<location filename="../qml/AlbumTitle.qml" line="175"/>
<source>Show side pane</source>
<translation>Show side pane</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="172"/>
<location filename="../qml/AlbumTitle.qml" line="175"/>
<source>Hide side pane</source>
<translation>Hide side pane</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="214"/>
<location filename="../qml/AlbumTitle.qml" line="217"/>
<source>Original ratio</source>
<translation>Original ratio</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="214"/>
<location filename="../qml/AlbumTitle.qml" line="217"/>
<source>Square thumbnails</source>
<translation>Square thumbnails</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="248"/>
<location filename="../qml/AlbumTitle.qml" line="324"/>
<location filename="../qml/AlbumTitle.qml" line="251"/>
<location filename="../qml/AlbumTitle.qml" line="327"/>
<source>Y</source>
<translation>Y</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="259"/>
<location filename="../qml/AlbumTitle.qml" line="325"/>
<location filename="../qml/AlbumTitle.qml" line="262"/>
<location filename="../qml/AlbumTitle.qml" line="328"/>
<source>M</source>
<translation>M</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="269"/>
<location filename="../qml/AlbumTitle.qml" line="326"/>
<location filename="../qml/AlbumTitle.qml" line="272"/>
<location filename="../qml/AlbumTitle.qml" line="329"/>
<source>D</source>
<translation>D</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="280"/>
<location filename="../qml/AlbumTitle.qml" line="327"/>
<location filename="../qml/AlbumTitle.qml" line="283"/>
<location filename="../qml/AlbumTitle.qml" line="330"/>
<source>All</source>
<translation>All</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="351"/>
<location filename="../qml/AlbumTitle.qml" line="354"/>
<source>Search</source>
<translation>Search</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="415"/>
<location filename="../qml/AlbumTitle.qml" line="418"/>
<source>Import Photos and Videos</source>
<translation type="unfinished">Import Photos and Videos</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="443"/>
<location filename="../qml/AlbumTitle.qml" line="446"/>
<source>Favorite</source>
<translation>Favorite</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="443"/>
<location filename="../qml/AlbumTitle.qml" line="446"/>
<source>Unfavorite</source>
<translation>Unfavorite</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="475"/>
<location filename="../qml/AlbumTitle.qml" line="478"/>
<source>Rotate</source>
<translation>Rotate</translation>
</message>
<message>
<location filename="../qml/AlbumTitle.qml" line="495"/>
<location filename="../qml/AlbumTitle.qml" line="498"/>
<source>Delete</source>
<translation>Delete</translation>
</message>
Expand Down Expand Up @@ -1071,28 +1086,28 @@
<context>
<name>MainAlbumView</name>
<message>
<location filename="../qml/MainAlbumView.qml" line="213"/>
<location filename="../qml/MainAlbumView.qml" line="214"/>
<source>Importing...</source>
<translation>Importing...</translation>
</message>
<message>
<location filename="../qml/MainAlbumView.qml" line="214"/>
<location filename="../qml/MainAlbumView.qml" line="226"/>
<location filename="../qml/MainAlbumView.qml" line="215"/>
<location filename="../qml/MainAlbumView.qml" line="227"/>
<source>Imported:</source>
<translation>Imported:</translation>
</message>
<message>
<location filename="../qml/MainAlbumView.qml" line="227"/>
<location filename="../qml/MainAlbumView.qml" line="228"/>
<source>%1/%2</source>
<translation>%1/%2</translation>
</message>
<message>
<location filename="../qml/MainAlbumView.qml" line="238"/>
<location filename="../qml/MainAlbumView.qml" line="239"/>
<source>Import successful</source>
<translation>Import successful</translation>
</message>
<message>
<location filename="../qml/MainAlbumView.qml" line="247"/>
<location filename="../qml/MainAlbumView.qml" line="248"/>
<source>Import failed</source>
<translation>Import failed</translation>
</message>
Expand Down
Loading

0 comments on commit 1b33bff

Please sign in to comment.