It is currently April 27th, 2024, 4:24 am

make horizontal links vertical

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: make horizontal links vertical

Post by Yincognito »

eclectic-tech wrote: August 14th, 2020, 2:02 am Late to the party for me!

Don't worry about that, this method, while it is easy to rotate the displayed meters, has lots of undesirable side effects as described in the link to "Working with angle on string meters".

Besides the hassles to resize the meters to prevent clipping, positioning meters is a lot of "trial and error" and the mouse reaction is still lacking (IMO).

So as you suggested, Image meters may be a better way to go to provide reliable mouse actions and meter arrangement variety.
Just a suggestion / idea: why not placing those rotated String meters on top of a "container" of some sort (could be Shape, Image, even a Container meter per se) and instead of applying the mouse actions on the (foreground) String meter, apply it on its (background) "container"? Wouldn't this solve the mouse reaction issue? :???:

In other words, avoid creating ready made images with the text already rotated (like mak_kawa did below) and just use those (blank) "containers" to solve the mouse problem.

P.S. This assumes the "container" meters are rotated as well, of course. The advantage is that this can be done relatively easy (if the angle is a dynamic variable, the "corners" of the "container" meter could be determined using Sin() and Cos(), I think, if no better option is available) and wouldn't require image editing whenever the text in the String meters change.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: make horizontal links vertical

Post by balala »

Yincognito wrote: August 13th, 2020, 9:00 pm you see what I mean?
Not entirely. (0*#Scale#) is 0, no matter what value has the Scale variable. Anyway finally there is no problem nor with X=(0*#Scale#)r, it works same well as X=0r, but it doesn't make too much sense for me.
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: make horizontal links vertical

Post by balala »

mak_kawa wrote: August 13th, 2020, 9:04 pm Ps.: In the case that section name includes spaces, #CURRENTSECTION# descriptions in the mouse actions have to be enveloped with ""; as "#CURRENTSECTION#".
Are there spaces into some section names? I didn't find them, but maybe I missed something.
Anyway, even if not forbiden, nor a good idea is to use spaces into section names (variable names or whatever name). It definitely does work, however on long term, it's gonna give a lot of headache.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: make horizontal links vertical

Post by Yincognito »

balala wrote: August 14th, 2020, 6:29 pm Not entirely. (0*#Scale#) is 0, no matter what value has the Scale variable. Anyway finally there is no problem nor with X=(0*#Scale#)r, it works same well as X=0r, but it doesn't make too much sense for me.
Yeah, my point was that it's either a leftover from pasting the meter (maybe the author found it easier to just zero the multiplier instead of deleting the entire formula and replacing it with the bare 0) or a matter of code semantics. Regarding the latter I too do this in my code, where I have a #SomeVariable#*#SomeMultiplier# type of formula (simplified example, of course), and when the multiplier is 1 I leave it like #SomeVariable#*1 instead of just #SomeVariable#, just to remind myself how that formula is calculated, and that the variable is always going to be multiplied by "something". It's more or less the same thing here, the only difference being that they represent a different property of multiplication - used to transmit something to the (potential) viewer.

In other words, I wasn't talking about math, but about code semantics (I don't know how to better call this, really). While when it comes to the former it indeed doesn't make sense like you said, it might make some sense when it comes to the latter. Hopefully you understood better what I meant this time. :)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: make horizontal links vertical

Post by balala »

Yincognito wrote: August 14th, 2020, 6:57 pm Regarding the latter I too do this in my code, where I have a #SomeVariable#*#SomeMultiplier# type of formula (simplified example, of course), and when the multiplier is 1 I leave it like #SomeVariable#*1 instead of just #SomeVariable#, just to remind myself how that formula is calculated, and that the variable is always going to be multiplied by "something". It's more or less the same thing here, the only difference being that they represent a different property of multiplication - used to transmit something to the (potential) viewer.

In other words, I wasn't talking about math, but about code semantics (I don't know how to better call this, really). While when it comes to the former it indeed doesn't make sense like you said, it might make some sense when it comes to the latter. Hopefully you understood better what I meant this time. :)
Yeah, might be and you probably are right. However there is a great difference between your example and this case: here the 0 is never changing, it is always 0 (it's not a variable).
Finally doesn't matter too much, since the X and Y options are working well, even in the way they are written.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: make horizontal links vertical

Post by Yincognito »

balala wrote: August 14th, 2020, 7:12 pm Yeah, might be and you probably are right. However there is a great difference between your example and this case: here the 0 is never changing, it is always 0 (it's not a variable).
Finally doesn't matter too much, since the X and Y options are working well, even in the way they are written.
Indeed. I just wanted to make sure you understood what I meant. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: make horizontal links vertical

Post by balala »

Yincognito wrote: August 14th, 2020, 7:17 pm Indeed. I just wanted to make sure you understood what I meant. ;-)
Yeah, yeah, I understood and you probably are perfectly right. Don't contest this...
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: make horizontal links vertical

Post by mak_kawa »

Hi balala
balala wrote: August 14th, 2020, 7:12 pm Are there spaces into some section names? I didn't find them
Maybe my English is bad...sorry, I want to say "In general, if the section name includes spaces...", not specific in the case of that code.
Why I added such Ps.? Because I saw this expression, [!UpdateMeter "#CURRENTSECTION#"] in your post, and thought why enclosed with quotation... ah, I got it!! :-)

As for 0*#Scale#, personally I prefer meaningless "formatting" of aligned formulas. :-)
Untitled-2.png
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: make horizontal links vertical

Post by balala »

mak_kawa wrote: August 14th, 2020, 8:27 pm Why I added such Ps.? Because I saw this expression, [!UpdateMeter "#CURRENTSECTION#"] in your post, and thought why enclosed with quotation... ah, I got it!! :-)
Alright, now I understand.
It's just a habit of mine. I'm never using spaces nor into section names, nor in variable names, however I always include the parameter of all bangs into quotes. For instance I never write a !SetVariable bang as [!SetVariable MyVariable 1], but as [!SetVariable MyVariable "1"]. Although not needed, I got this habit over time.
Some details:
https://forum.rainmeter.net/viewtopic.php?f=5&t=15253&p=85604#p85604
https://forum.rainmeter.net/viewtopic.php?f=5&t=27375&p=142041&p142041#p142041
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: make horizontal links vertical

Post by Yincognito »

eclectic-tech wrote: August 14th, 2020, 12:57 am Try this modified mak-kawa's code. Added a meter style for the text 'buttons'. Added an ANGLED variable and added Angle=#Angle# to the [ButtonStyle]. Added SolidColor=0,0,0,1 to [ButtonStyle] to improve mouse detection.

By changing the HSpacing, VSpacing, and Angled variables, you can control the display style: horizontal, vertical, rotated(vertical)

** NOTE: that rotated text does not change the mouse active area, so clicks will only work on the very center of the rotated text
See more about rotating text in this post by jsmorley
mak_kawa wrote: August 14th, 2020, 8:55 am Hi DrRoboculousand

Here is a quick example using image files (PNG). How about this? Each link is already rotated PNG file made by some graphic software. They are attached as a zip file.
Ok, so here is an alternative that solves the mouse active area issue (in eclectic-tech's code) and avoids creating rotated images each time the text in the String meters is modified (in mak_kawa's code):

Code: Select all

[Rainmeter]
Update=-1
Author=Connect-R, modified by mak_kawa with suggestion from balala.
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\#Language#.inc
Scale=0.33

; 0 for vertical | 150 for horizontal | 0 for rotated
HSpacing=0
; 50 for vertical | 0 for horizontal | 140 for rotated
VSpacing=140
; (Rad(90)) for rotated | (Rad(0)) for vertical or horizontal
Angled=(Rad(90))
; ** NOTE: that rotated text does not change the mouse active area, so clicks will only work on the very center of the rotated text

MouseOverSize=25
MouseLeaveSize=20
ScrollMouseIncrement=0.01

;-------------------------------------------------------------
;-------------------------------------------------------------

;HERE BELOW, YOU CAN CHANGE LINK NAMES AND PATHS.	

Name1=Google
Link1=chrome.exe

Name2=Facebook
Link2=https://facebook.com/

Name3=Twitter
Link3=https://twitter.com/

Name4=YouTube
Link4=https://www.youtube.com/

Name5=Behance
Link5=https://www.behance.net/

Name6=Gmail
Link6=https://mail.google.com/mail/

Name7=Deviantart
Link7=https://www.deviantart.com/popular-24-hours/

;-------------------------------------------------------------
[ButtonStyle]
StringAlign=Center
StringCase=Upper
FontFace=Futurist Fixed-width
FontColor=#TextColor#
FontSize=(#MouseLeaveSize#*#Scale#)
X=(#HSpacing#*#Scale#)r
Y=(#VSpacing#*#Scale#)r
AntiAlias=1
Angle=#Angled#

[LinkStyle]
X=0r
Y=0r
AntiAlias=1
Shape=Rectangle -[Meter#CURRENTSECTION#Button:H],(-[Meter#CURRENTSECTION#Button:W]/2),[Meter#CURRENTSECTION#Button:H],[Meter#CURRENTSECTION#Button:W] | StrokeWidth 0 | Stroke Color 255,0,0,255 | Fill Color 0,0,0,1
MouseOverAction=[!SetOption Meter#CURRENTSECTION#Button FontSize (#MouseOverSize#*#Scale#)][!UpdateMeterGroup #CURRENTSECTION#Group][!Redraw]
MouseLeaveAction=[!SetOption Meter#CURRENTSECTION#Button FontSize (#MouseLeaveSize#*#Scale#)][!UpdateMeterGroup #CURRENTSECTION#Group][!Redraw]
DynamicVariables=1

;-------------------------------------------------------------
[MeterLink1Button]
Group=Link1Group
Meter=String
MeterStyle=ButtonStyle
X=(140*#Scale#)
Y=(60*#Scale#)
Text="#Name1#"
LeftMouseUpAction=["#Link1#"]

[Link1]
Group=Link1Group
Meter=Shape
MeterStyle=LinkStyle
X=(140*#Scale#)
Y=(60*#Scale#)

[MeterLink2Button]
Group=Link2Group
Meter=String
MeterStyle=ButtonStyle
Text="#Name2#"
LeftMouseUpAction=["#Link2#"]

[Link2]
Group=Link2Group
Meter=Shape
MeterStyle=LinkStyle

[MeterLink3Button]
Group=Link3Group
Meter=String
MeterStyle=ButtonStyle
Text="#Name3#"
LeftMouseUpAction=["#Link3#"]

[Link3]
Group=Link3Group
Meter=Shape
MeterStyle=LinkStyle

[MeterLink4Button]
Group=Link4Group
Meter=String
MeterStyle=ButtonStyle
Text="#Name4#"
LeftMouseUpAction=["#Link4#"]

[Link4]
Group=Link4Group
Meter=Shape
MeterStyle=LinkStyle

[MeterLink5Button]
Group=Link5Group
Meter=String
MeterStyle=ButtonStyle
Text="#Name5#"
LeftMouseUpAction=["#Link5#"]

[Link5]
Group=Link5Group
Meter=Shape
MeterStyle=LinkStyle

[MeterLink6Button]
Group=Link6Group
Meter=String
MeterStyle=ButtonStyle
Text="#Name6#"
LeftMouseUpAction=["#Link6#"]

[Link6]
Group=Link6Group
Meter=Shape
MeterStyle=LinkStyle

[MeterLink7Button]
Group=Link7Group
Meter=String
MeterStyle=ButtonStyle
Text="#Name7#"
LeftMouseUpAction=["#Link7#"]

[Link7]
Group=Link7Group
Meter=Shape
MeterStyle=LinkStyle
The code is based on what eclectic-tech posted earlier. This basically adds some Shape meters having the same visual positions and dimensions as the String meters and uses these shapes to receive the mouse actions instead of the String meters. Bear in mind that this will only work for 90 degrees rotated strings, as this was the "last assignment". It can be made to work for whatever angle is set in the [Variables] section, but I have no idea if there is an interest for this scenario from the OP or anyone else, so I skipped doing this for the moment.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth