From bb6266fd1b2bb9a2f4cf4c7ce7c2e0d1831693ea Mon Sep 17 00:00:00 2001 From: JackLee_CN <809262979@qq.com> Date: Sat, 9 Nov 2024 13:33:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E9=BC=A0=E6=A0=87=E9=97=AE=E9=A2=98=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=BB=98=E8=AE=A4=E5=9C=B0=E5=9D=80=E6=96=9C?= =?UTF-8?q?=E6=9D=A0=E9=97=AE=E9=A2=98=20=E9=83=A8=E5=88=86qwdiget?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BC=A0=E6=A0=87=E8=BF=BD=E8=B8=AA=E8=A7=A3?= =?UTF-8?q?=E5=86=B3BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sui.cpp | 8 ++++++-- src/sui.h | 2 +- src/sui_title.cpp | 3 ++- src/xsteam_ex.cpp | 8 ++++---- src/xsteam_ui.cpp | 1 + 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/sui.cpp b/src/sui.cpp index 85ce240..f6a27b3 100644 --- a/src/sui.cpp +++ b/src/sui.cpp @@ -4,7 +4,8 @@ sui::sui(QWidget *parent) m_layout(new QVBoxLayout), m_widget(new QWidget), m_press(false), - m_border_width(5) + m_border_width(2), + ori(NONE) { m_title = new sui_title(this); setObjectName(tr("m_widget")); @@ -23,10 +24,14 @@ sui::sui(QWidget *parent) sui::~sui() { } + void sui::showEvent(QShowEvent *event) { this->setAttribute(Qt::WA_Mapped); QWidget::showEvent(event); + QSize oldSize = this->size(); + resize(oldSize + QSize(10, 10)); + resize(oldSize); } void sui::paintEvent(QPaintEvent *event) @@ -52,7 +57,6 @@ void sui::region(const QPoint ¤tGlobalPoint) // 当前鼠标的坐标 int x = currentGlobalPoint.x(); int y = currentGlobalPoint.y(); - if (((topLeft.x() + m_border_width >= x) && (topLeft.x() <= x)) && ((topLeft.y() + m_border_width >= y) && (topLeft.y() <= y))) { // 左上角 diff --git a/src/sui.h b/src/sui.h index acd1473..23c688b 100644 --- a/src/sui.h +++ b/src/sui.h @@ -35,7 +35,7 @@ private: sui_title *m_title; protected: void paintEvent(QPaintEvent *event); - void showEvent(QShowEvent *event); + void showEvent(QShowEvent *event); void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); diff --git a/src/sui_title.cpp b/src/sui_title.cpp index 396a9a2..c34aaf3 100644 --- a/src/sui_title.cpp +++ b/src/sui_title.cpp @@ -35,6 +35,7 @@ sui_title::sui_title(QWidget *parent) m_layout->addWidget(m_btn_vectors[3]); m_layout->setSpacing(5); m_layout->setContentsMargins(5, 0, 5, 0); + setMouseTracking(true); setFixedHeight(40); setLayout(m_layout); connect_slots(); @@ -158,8 +159,8 @@ void sui_title::slots_style_system() } void sui_title::set_font_style() { - slots_set_style_change(); slots_set_font_change(); + slots_set_style_change(); } void sui_title::slots_set_style_change() { diff --git a/src/xsteam_ex.cpp b/src/xsteam_ex.cpp index de9732a..a4ae460 100644 --- a/src/xsteam_ex.cpp +++ b/src/xsteam_ex.cpp @@ -378,8 +378,8 @@ void xsteam_data_unserialize() _data.x_config.steam_dir = (settings.value("SteamPath", "").toString()).toStdString(); _data.x_config.steam_api_url = "https://store.steampowered.com/api/appdetails/?appids="; _data.x_config.steam_logo_url = "https://shared.cloudflare.steamstatic.com/store_item_assets/steam/apps/"; - _data.x_config.steamtools_dir = _data.x_config.steam_dir + "/config/stUI/"; - _data.x_config.steamtools_st_dir = _data.x_config.steam_dir + "/config/stplug-in/"; + _data.x_config.steamtools_dir = _data.x_config.steam_dir + "/config/stUI"; + _data.x_config.steamtools_st_dir = _data.x_config.steam_dir + "/config/stplug-in"; } } // 序列化全局变量中需要保存在data.json目录下的数据 @@ -458,7 +458,7 @@ bool xsteam_lua_to_com(UidData u_data) // 文件路径的设定和检测 QString lua_file = ex_base_exe_ex + QString::fromStdString(u_data.uid) + ".lua"; QString lua_packa_file = ex_base_exe_ex + "luapacka.exe"; - QString lua_to_steam_st = QString::fromStdString(_data.x_config.steamtools_st_dir) + QString::fromStdString(u_data.uid) + ".st"; + QString lua_to_steam_st = QString::fromStdString(_data.x_config.steamtools_st_dir) +"/" +QString::fromStdString(u_data.uid) + ".st"; QFile _lua_file(lua_file); QFile _lua_packa_file(lua_packa_file); if (_lua_file.exists()) @@ -613,7 +613,7 @@ void xsteam_delete_uid_st(std::string uid) { if (it->uid == uid) { - QFile st(QString::fromStdString(_data.x_config.steamtools_st_dir + uid + ".st")); + QFile st(QString::fromStdString(_data.x_config.steamtools_st_dir +"/"+ uid + ".st")); if (st.exists()) { st.remove(); diff --git a/src/xsteam_ui.cpp b/src/xsteam_ui.cpp index 2967ba2..004b294 100644 --- a/src/xsteam_ui.cpp +++ b/src/xsteam_ui.cpp @@ -48,6 +48,7 @@ void xsteam_ui::xsteam_init_mind_layout() { title()->set_title(tr("XSteam")); mind_widget = new QWidget(); + mind_widget->setMouseTracking(true); mind_layout = new QVBoxLayout(); server_layout = new QHBoxLayout(); server_tag = new QLabel(tr("源数据:"));