Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
朱子楚\zhuzi committed Mar 17, 2024
1 parent f8dee13 commit c4cf4c1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
22 changes: 2 additions & 20 deletions src/FluFramelessHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down Expand Up @@ -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;
}
Expand All @@ -231,7 +214,6 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
FluFramelessHelper::FluFramelessHelper(QObject *parent)
: QObject{parent}
{

}

void FluFramelessHelper::classBegin(){
Expand Down
9 changes: 5 additions & 4 deletions src/Qt5/imports/FluentUI/Controls/FluTableView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
11 changes: 6 additions & 5 deletions src/Qt6/imports/FluentUI/Controls/FluTableView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Rectangle {
id:com_text
FluText {
id:item_text
text: String(display)
text: display
elide: Text.ElideRight
wrapMode: Text.WrapAnywhere
anchors{
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit c4cf4c1

Please sign in to comment.