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