This commit is contained in:
朱子楚\zhuzi 2024-03-17 11:17:59 +08:00
parent f8dee135a1
commit c4cf4c13b8
3 changed files with 13 additions and 29 deletions

View File

@ -35,25 +35,6 @@ static inline bool isCompositionEnabled(){
return false;
}
static inline void showShadow(HWND hwnd){
if(isCompositionEnabled()){
const MARGINS shadow = { 0, 0, 1, 0 };
typedef HRESULT (WINAPI* DwmExtendFrameIntoClientAreaPtr)(HWND hWnd, const MARGINS *pMarInset);
HMODULE module = LoadLibraryW(L"dwmapi.dll");
if (module)
{
DwmExtendFrameIntoClientAreaPtr dwm_extendframe_into_client_area_;
dwm_extendframe_into_client_area_= reinterpret_cast<DwmExtendFrameIntoClientAreaPtr>(GetProcAddress(module, "DwmExtendFrameIntoClientArea"));
if (dwm_extendframe_into_client_area_)
{
dwm_extendframe_into_client_area_(hwnd, &shadow);
}
}
}else{
ULONG_PTR cNewStyle = GetClassLongPtr(hwnd, GCL_STYLE) | CS_DROPSHADOW;
SetClassLongPtr(hwnd, GCL_STYLE, cNewStyle);
}
}
#endif
FramelessEventFilter::FramelessEventFilter(FluFramelessHelper* helper){
@ -218,6 +199,8 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
if(wParam == SC_MINIMIZE){
if(_helper->window->transientParent()){
_helper->window->transientParent()->showMinimized();
}else{
_helper->window->showMinimized();
}
return true;
}
@ -231,7 +214,6 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
FluFramelessHelper::FluFramelessHelper(QObject *parent)
: QObject{parent}
{
}
void FluFramelessHelper::classBegin(){

View File

@ -304,16 +304,17 @@ Rectangle {
property var display: itemModel.display
property int row: item_table.position.y
property int column: item_table.position.x
property bool isObject: typeof(display) == "object"
property var options: {
if(typeof(modelData) == "object"){
return modelData.options
if(isObject){
return display.options
}
return {}
}
anchors.fill: parent
sourceComponent: {
if(typeof(modelData) == "object"){
return modelData.comId
if(isObject){
return display.comId
}
return com_text
}

View File

@ -142,7 +142,7 @@ Rectangle {
id:com_text
FluText {
id:item_text
text: String(display)
text: display
elide: Text.ElideRight
wrapMode: Text.WrapAnywhere
anchors{
@ -306,16 +306,17 @@ Rectangle {
property var display: itemModel.display
property int row: item_table.position.y
property int column: item_table.position.x
property bool isObject: typeof(display) == "object"
property var options: {
if(typeof(modelData) == "object"){
return modelData.options
if(isObject){
return display.options
}
return {}
}
anchors.fill: parent
sourceComponent: {
if(typeof(modelData) == "object"){
return modelData.comId
if(isObject){
return display.comId
}
return com_text
}