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("源数据:"));