It is currently May 1st, 2024, 12:19 pm

Little confused about DragMargins

Get help with creating, editing & fixing problems with skins
User avatar
lysy1993lbn
Posts: 291
Joined: July 25th, 2011, 9:53 am
Location: Lublin, Poland

Little confused about DragMargins

Post by lysy1993lbn »

I'm trying to define Dragable area in my skin, but i'm kinda confused how..
• DragMargins
  • Defines the area from where the window can be dragged. You need to define 4 values separated with comma. The values define the margin of non-draggable area. It's also possible to use negative numbers in which case the margin is calculated from the opposite side. E.g. DragMargins=0,-100,0,0
So I guess that area should be defined like TOPx, TOPy, BOTTOMx, BOTTOMy.
I'm little confused about it becouse tried define the exclude area as well as only deserved dragable area and either didn't work..

Could someone give an example on this?
Image
I want that only green marked area be dragable and all the way down don't..
"Never argue with an idiot, he will drag you down to his level and beat you with experience."
my deviantART | Alternative Rainmeter tray icons
User avatar
lysy1993lbn
Posts: 291
Joined: July 25th, 2011, 9:53 am
Location: Lublin, Poland

Re: Little confused about DragMargins

Post by lysy1993lbn »

anyone?
"Never argue with an idiot, he will drag you down to his level and beat you with experience."
my deviantART | Alternative Rainmeter tray icons
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Little confused about DragMargins

Post by jsmorley »

The documentation is sorta misleading. We will work on that.

What it really does is use TopX, TopY, BottomX, and BottomY to define an area that is NOT draggable in the skin. If you use negative numbers, the margin is applied in the opposite way. (more or less "reversed")

So if we have your image, which is 575 X 371 (when I roughly cropped it in photoshop)

We want to define the top 26 pixels and the full width of 371 as "draggable", while making the rest of the skin not.

So we would use:

DragMargins=0,0,0,-26

What this is saying is that there should be no non-draggable margin set left, top or right. Then we make everything non-draggable except the top 26 pixels by using -26, which since it is applied to "BottomY", means make everything except the top 26 pixels non-draggable. it is in effect saying "take the full height of 575, then subtract 26 from the top (remember the negative number reverses the effect) and make the rest, 549, non-draggable."

This is not terribly intuitive I know, particularly the effect that negative numbers have. I need to figure out a clear unambiguous way to define this function for the manual.
User avatar
lysy1993lbn
Posts: 291
Joined: July 25th, 2011, 9:53 am
Location: Lublin, Poland

Re: Little confused about DragMargins

Post by lysy1993lbn »

lol.. I was trying do it opposite way :oops:
It's clear for me now :) Thanks jsmorley :thumbup:
"Never argue with an idiot, he will drag you down to his level and beat you with experience."
my deviantART | Alternative Rainmeter tray icons