Skip to content

Commit

Permalink
fix: Modify the interface style
Browse files Browse the repository at this point in the history
Modify the interface style

Bug: https://pms.uniontech.com/bug-view-277187.html
Log: Modify the interface style
  • Loading branch information
pengfeixx committed Oct 17, 2024
1 parent 91fca31 commit eb04e50
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 26 deletions.
1 change: 1 addition & 0 deletions src/common/VNoteMainManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void VNoteMainManager::initConnections()
connect(m_richTextManager, &WebRichTextManager::needUpdateNote, this, &VNoteMainManager::needUpdateNote);
connect(m_richTextManager, &WebRichTextManager::noteTextChanged, this, &VNoteMainManager::onNoteChanged, Qt::QueuedConnection);
connect(m_richTextManager, &WebRichTextManager::updateSearch, this, &VNoteMainManager::updateSearch);
connect(m_richTextManager, &WebRichTextManager::scrollChange, this, &VNoteMainManager::scrollChange);
connect(VoiceRecoderHandler::instance(), &VoiceRecoderHandler::finishedRecod, this, &VNoteMainManager::insertVoice);
}

Expand Down
1 change: 1 addition & 0 deletions src/common/VNoteMainManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class VNoteMainManager : public QObject
void moveFinished(const QVariantList &index, const int &srcFolderIndex, const int &dstFolderIndex);
void needUpdateNote();
void updateRichTextSearch(const QString &key);
void scrollChange(const bool &isTop);

private slots:
void onVNoteFoldersLoaded();
Expand Down
5 changes: 5 additions & 0 deletions src/common/jscontent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ QString JsContent::jsCallDivTextTranslation()
return doc.toJson(QJsonDocument::Compact);
}

void JsContent::jsCallScrollChange(int scrollTop)
{
emit scrollTopChange(scrollTop == 0);
}

/**
@brief Js前端调用停止播放
*/
Expand Down
3 changes: 3 additions & 0 deletions src/common/jscontent.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class JsContent : public QObject
void callJsSetFontList(const QStringList &list, const QString &font);
void getfontinfo(); //获取字体列表信息信号

void scrollTopChange(const bool &isTop);

protected:
JsContent();

Expand All @@ -113,6 +115,7 @@ public slots:
void jsCallSetClipData(const QString &text, const QString &html); //web前端调用后端,设置剪切板内容
QString jsCallGetTranslation(); //web前端调用后端,获取翻译
QString jsCallDivTextTranslation(); // web前端调用后端,获取动态组件翻译
void jsCallScrollChange(int scrollTop);
void jsCallPlayVoiceStop(); // web前端调用后端,停止播放
void jsCallVoiceProgressChange(qint64 progressMs); // web前端调用后端,变更播放进度
void onClipChange(QClipboard::Mode mode);
Expand Down
4 changes: 4 additions & 0 deletions src/common/webrichetextmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ void WebRichTextManager::initConnect()
m_textChange = true;
emit noteTextChanged();
});

connect(JsContent::instance(), &JsContent::scrollTopChange, this, [=](bool isTop){
emit scrollChange(isTop);
});
}

void WebRichTextManager::setData(VNoteItem *data, const QString reg)
Expand Down
1 change: 1 addition & 0 deletions src/common/webrichetextmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public slots:
void needUpdateNote();
void noteTextChanged();
void updateSearch();
void scrollChange(const bool &isTop);

private:
void setData(VNoteItem *data, const QString reg);
Expand Down
5 changes: 4 additions & 1 deletion src/gui/mainwindow/FolderListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Item {
property bool isRename: false
property var startMove: [-1, -1]

color: index === folderListView.currentIndex ? "#33000000" : (isHovered ? "#1A000000" : "transparent")
color: index === folderListView.currentIndex ? (root.activeFocus ? "#1F6DE4" : DTK.themeType === ApplicationHelper.LightType ? "#33000000" : "#33FFFFFF") : (isHovered ? (DTK.themeType === ApplicationHelper.LightType ? "#1A000000" : "#1AFFFFFF") : "transparent")
enabled: folderListView.enabled
height: itemHeight
radius: 6
Expand All @@ -231,6 +231,7 @@ Item {
break;
case Qt.Key_Escape:
isRename = false;
root.forceActiveFocus();
break;
default:
break;
Expand Down Expand Up @@ -330,6 +331,7 @@ Item {
id: folderNameLabel

Layout.fillWidth: true
color: index === folderListView.currentIndex ? (root.activeFocus ? "white" : (DTK.themeType === ApplicationHelper.LightType ? "black" : "#B2FFFFFF")) : (DTK.themeType === ApplicationHelper.LightType ? "black" : "#B2FFFFFF")
elide: Text.ElideRight
font.pixelSize: 14
horizontalAlignment: Text.AlignLeft
Expand All @@ -342,6 +344,7 @@ Item {
id: folderCountLabel

Layout.rightMargin: 10
color: folderNameLabel.color
font.pixelSize: 14
horizontalAlignment: Text.AlignRight
text: model.count
Expand Down
6 changes: 3 additions & 3 deletions src/gui/mainwindow/ItemListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ Item {
property bool isSelected: false
property var startMove: [-1, -1]

color: isSelected ? "#FF1F6EE7" : (DTK.themeType === ApplicationHelper.LightType ? "white" : "#212944")
color: isSelected ? (rootItem.activeFocus ? "#FF1F6EE7" : (DTK.themeType === ApplicationHelper.LightType ? "#33000000" : "#33FFFFFF")) : (DTK.themeType === ApplicationHelper.LightType ? "white" : "#202944")
height: isSearch ? 67 : 50
radius: 6
width: itemListView.width
Expand Down Expand Up @@ -385,7 +385,7 @@ Item {
Label {
id: noteNameLabel

color: isSelected ? "white" : (DTK.themeType === ApplicationHelper.LightType ? "black" : "white")
color: DTK.themeType === ApplicationHelper.LightType ? (isSelected ? (rootItem.activeFocus ? "white" : "black") : "black") : "white"
font.pixelSize: 14
height: 18
horizontalAlignment: Text.AlignHLeft
Expand All @@ -397,7 +397,7 @@ Item {
Label {
id: timeLabel

color: isSelected ? "#7FFFFFFF" : (DTK.themeType === ApplicationHelper.LightType ? "#7F000000" : "#7FFFFFFF")
color: isSelected ? (rootItem.activeFocus ? "#7FFFFFFF" : DTK.themeType === ApplicationHelper.LightType ? "#7F000000" : "#7FFFFFFF") : (DTK.themeType === ApplicationHelper.LightType ? "#7F000000" : "#7FFFFFFF")
font.pixelSize: 10
height: 15
horizontalAlignment: Text.AlignHLeft
Expand Down
4 changes: 2 additions & 2 deletions src/gui/mainwindow/MainWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ ApplicationWindow {

Layout.fillHeight: true//#F2F6F8
Layout.preferredWidth: leftViewWidth
color: DTK.themeType === ApplicationHelper.LightType ? "#EBF6FF" : "#101010"
color: DTK.themeType === ApplicationHelper.LightType ? "#EBF6FF" : "#2E1F60"

ColumnLayout {
anchors.bottomMargin: 10
Expand Down Expand Up @@ -360,7 +360,7 @@ ApplicationWindow {

Layout.fillHeight: true
Layout.preferredWidth: leftViewWidth
color: DTK.themeType === ApplicationHelper.LightType ? "#F1F5F8" : "#D9000000"
color: DTK.themeType === ApplicationHelper.LightType ? "#F1F5F8" : "#14183A"

onWidthChanged: {
if (!leftBgArea.visible) {
Expand Down
6 changes: 3 additions & 3 deletions src/gui/mainwindow/RecordingView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Item {

Rectangle {
anchors.fill: parent
border.color: "#0A000000"
border.color: DTK.themeType === ApplicationHelper.LightType ? "#0A000000" : "#19FFFFFF"
border.width: 1
color: "#7FF4F4F4"
color: DTK.themeType === ApplicationHelper.LightType ? "#7FF4F4F4" : "#0A0A10"
radius: 12
}

Expand Down Expand Up @@ -57,7 +57,7 @@ Item {
width: 180
}

Text {
Label {
id: duation

text: time
Expand Down
13 changes: 13 additions & 0 deletions src/gui/mainwindow/WebEngineView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import "../dialog"
Item {
id: rootItem

property bool hasScroll: false
property bool noSearchResult: false
property bool webVisible: true

Expand Down Expand Up @@ -62,6 +63,7 @@ Item {
id: columnLayout

anchors.fill: parent
spacing: 0

WindowTitleBar {
id: title
Expand Down Expand Up @@ -150,6 +152,14 @@ Item {

}
}

Rectangle {
anchors.top: webRect.top
border.width: 0
color: hasScroll ? (DTK.themeType === ApplicationHelper.LightType ? "#0C000000" : "#0CFFFFFF") : "transparent"
height: 1
width: parent.width
}
}

Loader {
Expand Down Expand Up @@ -329,6 +339,9 @@ Item {
VNoteMainManager.updateNoteWithResult(result);
});
}
onScrollChange: isTop => {
hasScroll = !isTop;
}
onUpdateRichTextSearch: key => {
webView.findText(key);
}
Expand Down
4 changes: 4 additions & 0 deletions src/gui/mainwindow/WindowTitleBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ TitleBar {
signal insertImage
signal startRecording

enableInWindowBlendBlur: false
height: 40
width: 0

background: Rectangle {
color: DTK.themeType === ApplicationHelper.LightType ? "white" : "black"
}
menu: Menu {
width: 200
x: 0
Expand Down
16 changes: 14 additions & 2 deletions src/web/css/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ strike[style="text-decoration-line: underline;"] {
color: rgba(192, 198, 212, 1);
}

.icon-backcolor .path5 {
.icon-backcolor .path2 {
color: rgb(255, 255, 255, .2);
}

Expand Down Expand Up @@ -123,8 +123,20 @@ body::-webkit-scrollbar-thumb:active,

/********** 悬浮语言播放控件 **********/
.airVoicePlaybackContainer .voicePlayback {
background: #09090F !important;
background: #171623 !important;
border: 1px solid rgb(255, 255, 255, 0.05);
outline: 1px solid rgb(0, 0, 0, 0.6);
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.voicePlayback .voiceBtn {
background-image: url('../img/audio_file_play/Normal/Dark.svg');
}

.voicePlayback .voiceBtn:hover {
background-image: url('../img/audio_file_play/Hover/Dark.svg');
}

.voicePlayback .voiceBtn:active {
background-image: url('../img/audio_file_play/Pressed/Dark.svg');
}
12 changes: 0 additions & 12 deletions src/web/css/voiceplayback.css
Original file line number Diff line number Diff line change
Expand Up @@ -322,26 +322,14 @@
background-image: url('../img/audio_file_play/Normal/Light.svg');
}

.body.dark .voicePlayback .voiceBtn {
background-image: url('../img/audio_file_play/Normal/Dark.svg');
}

.voicePlayback .voiceBtn:hover {
background-image: url('../img/audio_file_play/Hover/Light.svg');
}

.body.dark .voicePlayback .voiceBtn:hover {
background-image: url('../img/audio_file_play/Hover/Dark.svg');
}

.voicePlayback .voiceBtn:active {
background-image: url('../img/audio_file_play/Pressed/Light.svg');
}

.body.dark .voicePlayback .voiceBtn:active {
background-image: url('../img/audio_file_play/Pressed/Dark.svg');
}

/* 播放状态的播放暂停按钮 */
.voicePlayback.play .voiceBtn {
background-image: none;
Expand Down
4 changes: 2 additions & 2 deletions src/web/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body {
line-height: 1.72;
font-family: 'Helvetica';
background-color: var(--backgroundColor);
color: rgba(65, 77, 104, 1);
color: rgba(0, 0, 0, 1);
word-wrap: break-word;
}

Expand Down Expand Up @@ -189,4 +189,4 @@ strike {
strike[style="text-decoration-line: underline;"] {
text-decoration-color: transparent !important;
border-bottom: 1px solid rgba(65, 77, 104, 1);
}
}
5 changes: 4 additions & 1 deletion src/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,9 @@ function resetScroll() {

// 监听滚动事件
$(document).scroll(function () {
var scrollTopDistance = $(document).scrollTop();
webobj.jsCallScrollChange(scrollTopDistance);

if (scrollHide) {
clearTimeout(scrollHide)
$('#scrollStyle').html(`
Expand Down Expand Up @@ -1568,4 +1571,4 @@ function toggleVoiceToTextState(translateHeader) {
}
}

/***** 语音转文本相关函数 end *****/
/***** 语音转文本相关函数 end *****/

0 comments on commit eb04e50

Please sign in to comment.