Skip to content

Commit

Permalink
文件管理器支持设置右下角小图
Browse files Browse the repository at this point in the history
  • Loading branch information
gfdgd-xi committed Nov 21, 2024
1 parent 95a953f commit 7f38537
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions dde-file-manager-lib/themes/dark/DFileManagerWindow.theme
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ QPushButton#LogoButton:press{
}

QFrame#CentralWidget{
background-position: right bottom;
background-color: transparent;
border-top: 1px insert rgba(255, 255, 255, 0.05);
}
Expand Down Expand Up @@ -452,6 +453,7 @@ QPushButton#close:hover{

QScrollArea#ComputerView{
border: none;
background-color: transparent;
/*background-color: white;*/
}

Expand Down
1 change: 1 addition & 0 deletions dde-file-manager-lib/themes/dark/DFileViewRoot.theme
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
QListView {
background: #202020;
background-color: transparent;
border: none;
}

Expand Down
6 changes: 4 additions & 2 deletions dde-file-manager-lib/themes/light/DFileManagerWindow.theme
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ QMainWindow{
background-color: white;
}


QPushButton#LogoButton{
border: none;
image: url(:/images/images/dde-file-manager.png);
Expand All @@ -19,6 +18,8 @@ QPushButton#LogoButton:press{
}

QFrame#CentralWidget{
background-position: right bottom;
background-color: transparent;
border-top: 1px solid rgba(0, 0, 0, 0.1);
}

Expand Down Expand Up @@ -487,7 +488,8 @@ QLineEdit#BookmarkLineEdit{

QScrollArea#ComputerView{
border: none;
background-color: white;
/*background-color: white;*/
background-color: transparent;
}

QScrollArea#ComputerView #TitleLabel {
Expand Down
3 changes: 2 additions & 1 deletion dde-file-manager-lib/themes/light/DFileView.theme
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
QListView {
background: white;
/*background: white;*/
background: transparent;
border: none;
}

Expand Down
11 changes: 11 additions & 0 deletions dde-file-manager-lib/views/dfilemanagerwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,8 @@ void DFileManagerWindow::initUI()
initCentralWidget();
initTitleBar();
setCentralWidget(d->centralWidget);

refreshBackgroundPicture();
}

void DFileManagerWindow::initTitleFrame()
Expand Down Expand Up @@ -1197,6 +1199,14 @@ void DFileManagerWindow::setTheme(const QString &theme)
}
}

void DFileManagerWindow::refreshBackgroundPicture()
{
QString theme = DThemeManager::instance()->theme(this);
this->setStyleSheet(this->styleSheet() + " QFrame#CentralWidget{"
"background: url(" + QDir::homePath() + "/.config/GXDE/dde-file-manager/background-" + theme + ".png) no-repeat;" +
"background-position: right bottom;}");
}

void DFileManagerWindow::onThemeChanged()
{
QString theme = DThemeManager::instance()->theme(this);
Expand All @@ -1211,6 +1221,7 @@ void DFileManagerWindow::onThemeChanged()
}

WindowManager::instance()->saveWindowState(this);
refreshBackgroundPicture();
}

void DFileManagerWindow::showEvent(QShowEvent *event)
Expand Down
2 changes: 2 additions & 0 deletions dde-file-manager-lib/views/dfilemanagerwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ public slots:
QScopedPointer<DFileManagerWindowPrivate> d_ptr;
Q_DECLARE_PRIVATE_D(qGetPtrHelper(d_ptr), DFileManagerWindow)

void refreshBackgroundPicture();

public:
static std::unique_ptr<RecordRenameBarState> renameBarState;//###: record pattern of RenameBar and the string of QLineEdit's content.
static std::atomic<bool> flagForNewWindowFromTab; //###: open a new window form a already has tab, this will be true.
Expand Down
2 changes: 1 addition & 1 deletion usb-device-formatter/translations/policy/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<name>policy</name>
<message>
<location filename="com.deepin.pkexec.usb-device-formatter!message" line="0" />
<source>Authentication is required to run the USB Device Formatter</source>
<source>Authentication is required to run the Device Formatter</source>
<translation type="unfinished" />
</message>
</context>
Expand Down

0 comments on commit 7f38537

Please sign in to comment.