twin-style-dekorator - resize handle sizing patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I wrote a small patch that makes twin-deKorator take into account the sizes of the '[left|right]BottomsFrameBg.png' and '[left|right]BottomFrameBg.png' to determine the lower resize handles, since on most themes those tend to end up quite small.

This also allows having usable resize handles even if some borders are small (e.g. 1px frames, depending on the image sizes, don't automatically result in 1px small handles, enabling *box-style themes).

The patch:

--- deKoratorclient.cpp    2025-02-19 19:46:49.126353500 +0100
+++ deKoratorclient_new_resize_handle_sizing.cpp    2025-02-22 09:57:55.272956410 +0100
@@ -2219,37 +2219,39 @@
     else if ( point.y() >= ( height() - BUTTOMFRAMESIZE ) )
     {
         // inside handle
-        if ( point.x() <= LEFTFRAMESIZE )
+        if ( point.x() <= std::max( LEFTBOTTOMFRAMEWIDTH, LEFTFRAMESIZE ) )
             pos = PositionBottomLeft;
-        else if ( point.x() >= ( width() - RIGHTFRAMESIZE ) )
+        else if ( point.x() >= ( width() - std::max( RIGHTBOTTOMFRAMEWIDTH, RIGHTFRAMESIZE ) ) )
             pos = PositionBottomRight;
         else
             pos = PositionBottom;
     }
-    else if ( point.x() <= LEFTFRAMESIZE )
-    {
-        // on left frame
-        if ( point.y() <= TITLESIZE )
-            pos = PositionTopLeft;
-        else if ( point.y() >= ( height() - BUTTOMFRAMESIZE ) )
-            pos = PositionBottomLeft;
-        else
-            pos = PositionLeft;
-    }
-    else if ( point.x() >= width() - RIGHTFRAMESIZE )
-    {
-        // on right frame
-        if ( point.y() <= TITLESIZE )
-            pos = PositionTopRight;
-        else if ( point.y() >= ( height() - BUTTOMFRAMESIZE ) )
-            pos = PositionBottomRight;
+    else {
+        if ( point.x() <= LEFTFRAMESIZE )
+        {
+            // on left frame
+            if ( point.y() <= TITLESIZE )
+                pos = PositionTopLeft;
+            else if ( point.y() >= ( height() - BOTTOMLEFTFRAMEHEIGHT - BUTTOMFRAMESIZE ) )
+                pos = PositionBottomLeft;            
+            else
+                pos = PositionLeft;
+        }
+        else if ( point.x() >= width() - RIGHTFRAMESIZE )
+        {
+            // on right frame
+            if ( point.y() <= TITLESIZE )
+                pos = PositionTopRight;
+            else if ( point.y() >= ( height() - BOTTOMRIGHTFRAMEHEIGHT - BUTTOMFRAMESIZE ) )
+                pos = PositionBottomRight; 
+            else
+                pos = PositionRight;
+        }
         else
-            pos = PositionRight;
-    }
-    else
-    {
-        // inside the frame
-        pos = PositionCenter;
+        {
+            // inside the frame
+            pos = PositionCenter;
+        }
     }
     return pos;
 

 


Best regards,
Daniel

____________________________________________________
tde-devels mailing list -- devels@xxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devels-leave@xxxxxxxxxxxxxxxxxx
Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/devels@xxxxxxxxxxxxxxxxxx

[Index of Archives]     [Trinity Users]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [KDE]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux