mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-27 15:44:12 +08:00
fix
This commit is contained in:
parent
9fce9e0060
commit
99d32ad415
@ -1069,7 +1069,7 @@ class MAINUI:
|
||||
except:
|
||||
return
|
||||
if widget == self.translation_ui:
|
||||
winsharedutils.showintab(int(widget.winId()), globalconfig["showintab"])
|
||||
winsharedutils.showintab_ex(int(widget.winId()), globalconfig["showintab"])
|
||||
return
|
||||
window_flags = widget.windowFlags()
|
||||
if (
|
||||
@ -1190,7 +1190,7 @@ class MAINUI:
|
||||
self.parsedefaultfont()
|
||||
self.loadmetadatas()
|
||||
self.translation_ui = QUnFrameWindow()
|
||||
winsharedutils.showintab(
|
||||
winsharedutils.showintab_ex(
|
||||
int(self.translation_ui.winId()), globalconfig["showintab"]
|
||||
)
|
||||
self.translation_ui.show()
|
||||
|
@ -621,8 +621,7 @@ class QUnFrameWindow(resizableframeless):
|
||||
super(QUnFrameWindow, self).__init__(
|
||||
None,
|
||||
flags=Qt.WindowType.FramelessWindowHint
|
||||
| Qt.WindowType.WindowMinimizeButtonHint
|
||||
| Qt.WindowType.Tool,
|
||||
| Qt.WindowType.WindowMinimizeButtonHint,
|
||||
poslist=globalconfig["transuigeo"],
|
||||
) # 设置为顶级窗口,无边框
|
||||
icon = getExeIcon(sys.argv[0]) #'./LunaTranslator.exe')# QIcon()
|
||||
|
@ -252,6 +252,8 @@ def SetTheme(hwnd, dark, backdrop):
|
||||
|
||||
showintab = utilsdll.showintab
|
||||
showintab.argtypes = HWND, c_bool
|
||||
showintab_ex = utilsdll.showintab_ex
|
||||
showintab_ex.argtypes = HWND, c_bool
|
||||
|
||||
|
||||
class windowstatus(Structure):
|
||||
|
@ -20,6 +20,23 @@ DECLARE void showintab(HWND hwnd, bool show)
|
||||
SetWindowLong(hwnd, GWL_EXSTYLE, style_ex);
|
||||
}
|
||||
|
||||
DECLARE void showintab_ex(HWND hwnd, bool show)
|
||||
{
|
||||
LONG style = GetWindowLong(hwnd, GWL_STYLE);
|
||||
auto style_ex = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
if (show)
|
||||
{
|
||||
style_ex |= WS_EX_APPWINDOW;
|
||||
style_ex &= ~WS_EX_TOOLWINDOW;
|
||||
}
|
||||
else
|
||||
{
|
||||
style_ex &= ~WS_EX_APPWINDOW;
|
||||
style_ex |= WS_EX_TOOLWINDOW;
|
||||
}
|
||||
SetWindowLong(hwnd, GWL_EXSTYLE, style_ex);
|
||||
}
|
||||
|
||||
struct windowstatus
|
||||
{
|
||||
WINDOWPLACEMENT wpc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user