2026年5月25日15:57:50

This commit is contained in:
2026-05-25 15:58:11 +08:00
parent 1cb9d5ac42
commit 358a56f602
20 changed files with 413 additions and 492 deletions
+9 -2
View File
@@ -25,6 +25,13 @@ FileManageWidget::FileManageWidget(QWidget *parent) :
ui->systemFileListView->setProperty("searchPath", DOC_ROOT_DIR);
ui->udiskFileListView->setProperty("searchPath", UDISK_DOC_ROOT_DIR);
// 清理ui文件中,用于调试的item
ui->systemFileListView->clear();
ui->udiskFileListView->clear();
ui->systemFileListView->setMouseTracking(true);
ui->udiskFileListView->setMouseTracking(true);
updateUDiskDevList();
m_focusedListView = ui->systemFileListView;
@@ -47,7 +54,7 @@ bool FileManageWidget::eventFilter(QObject *watched, QEvent *event)
return false;
}
if(event->type() != QEvent::FocusIn) {
if(event->type() != QEvent::FocusIn && event->type() != QEvent::MouseMove && event->type() != QEvent::MouseButtonPress) {
return false;
}
@@ -65,7 +72,7 @@ bool FileManageWidget::eventFilter(QObject *watched, QEvent *event)
m_focusedListView = dynamic_cast<QListWidget *>(watched);
backgroundPanel = dynamic_cast<QWidget *>(watched->parent());
palette = backgroundPanel->palette();
palette.setColor(backgroundPanel->backgroundRole(), QColor(175, 218, 223));
palette.setColor(backgroundPanel->backgroundRole(), "#5396C1");
backgroundPanel->setPalette(palette);
return false;
+144 -10
View File
@@ -77,6 +77,65 @@
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<property name="styleSheet">
<string notr="true">QScrollBar:vertical {
width: 30px; /* 滚动条宽度 */
background: #c0c0c0; /* 轨道背景色 */
margin: 0px; /* 为上下箭头预留空间 */
border-radius: 4px; /* 整体圆角 */
}
QListWidget QScrollBar::handle:vertical {
background-color: #5396C1;
min-height: 30px;
border-radius: 5px;
border:1px solid rgb(51, 51, 51);
}
/* 如果需要隐藏上下箭头按钮,添加以下代码 */
QListWidget QScrollBar::sub-line:vertical,
QListWidget QScrollBar::add-line:vertical {
border: none;
background: none;
}
QComboBox {
border: 1px solid #000000;
border-radius: 3px;
font-size: 14px;
height: 31px;
padding-left: 10px; /* 文字左边距,避免紧贴边缘 */
}
/* 下拉箭头区域 */
QComboBox::drop-down {
border: 1px solid #333333;
border-radius: 3px;
width: 30px; /* 箭头区域宽度 */
background-color: #5396C1;
}
/* 下拉箭头图标 */
QComboBox::down-arrow {
image: url(image/down_white.png);
width: 16px; /* 图标显示宽度 */
height: 16px; /* 图标显示高度 */
}
/* 悬停状态 */
QComboBox:hover {
background-color: #efefef;
}
QComboBox QAbstractItemView {
border: 1px solid #000000;
border-radius: 3px;
font-size: 16px;
selection-background-color: #5396C1; /* 选中项背景色(稍深) */
selection-color: #ffffff;
}
</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="spacing">
<number>0</number>
@@ -280,16 +339,16 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>2</number>
<number>1</number>
</property>
<property name="topMargin">
<number>2</number>
<number>1</number>
</property>
<property name="rightMargin">
<number>2</number>
<number>1</number>
</property>
<property name="bottomMargin">
<number>2</number>
<number>1</number>
</property>
<property name="spacing">
<number>6</number>
@@ -299,7 +358,7 @@
<property name="styleSheet">
<string notr="true">QListWidget {
border: 1px;
padding: 5px;
padding: 3px;
}
QListWidget::item {
@@ -309,6 +368,81 @@ QListWidget::item {
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
<item>
<property name="text">
<string>3</string>
</property>
</item>
<item>
<property name="text">
<string>4</string>
</property>
</item>
<item>
<property name="text">
<string>5</string>
</property>
</item>
<item>
<property name="text">
<string>6</string>
</property>
</item>
<item>
<property name="text">
<string>7</string>
</property>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
<item>
<property name="text">
<string>9</string>
</property>
</item>
<item>
<property name="text">
<string>0</string>
</property>
</item>
<item>
<property name="text">
<string>-</string>
</property>
</item>
<item>
<property name="text">
<string>新建项目</string>
</property>
</item>
<item>
<property name="text">
<string>324</string>
</property>
</item>
<item>
<property name="text">
<string>45fds</string>
</property>
</item>
<item>
<property name="text">
<string>2313</string>
</property>
</item>
</widget>
</item>
</layout>
@@ -324,23 +458,23 @@ QListWidget::item {
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>2</number>
<number>1</number>
</property>
<property name="topMargin">
<number>2</number>
<number>1</number>
</property>
<property name="rightMargin">
<number>2</number>
<number>1</number>
</property>
<property name="bottomMargin">
<number>2</number>
<number>1</number>
</property>
<item row="0" column="0">
<widget class="QListWidget" name="udiskFileListView">
<property name="styleSheet">
<string notr="true">QListWidget {
border: 1px;
padding: 5px;
padding: 3px;
}
QListWidget::item {