It is currently April 26th, 2024, 6:34 pm

Click to copy text?

Get help with creating, editing & fixing problems with skins
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Click to copy text?

Post by sl23 »

jsmorley wrote: September 2nd, 2021, 9:50 am Yes, like this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Icon1=\xe756

[MeterOne]
Meter=String
FontSize=30
Text=[#Icon1#]
FontFace=Segoe Fluent Icons
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
LeftMouseUpAction=[!SetClip "[*#Icon1#*]"]
Ok, so, I tried this, but I remembered after doing the above that I already did it before for some reason, maybe simply to eliminate the code from the Variables section by removing the square brackets to the mouse action.

Anyway, by doing the above, it breaks the code, which is why I never used it beforehand. Currently, I have 20 icons per page. but not all pages are used, they are spare, ready for adding more icon codes into the variables that are already present in each skins INI file.

These spare slots are therefore currently blank, as the call for them is "" ie. no text. But if I change the code to the above suggestion and move the square brackets to the mouse action, every spare slot shows 4 small squares as the call isn't "" but is now changed to "[]". With no text but a call for something unknown, instead of blank text.

Hopefully you get the gist of what I am saying?

This: [!SetClip "[*##CURRENTSECTION#*]"] gives this: [*#Icon1#*].
Changing the code to:

Code: Select all

[sAllIcons]
FontFace=Segoe Fluent Icons
FontSize=14
FontColor=#Color1#
AntiAlias=1
Text=[[##CURRENTSECTION#]]
LeftMouseUpAction=[!EnableMouseAction * "MouseOverAction|MouseLeaveAction"] [!SetVariable Preview [##CURRENTSECTION#]] [!SetOptionGroup Preview FontColor "#Color1#"] [!UpdateMeterGroup Preview] [!SetOption #CURRENTSECTION# FontColor "#Color4#"] [!UpdateMeter #CURRENTSECTION#] [!Redraw] [!DisableMouseAction #CurrentSection# "MouseOverAction|MouseLeaveAction"][!SetClip "[*##CURRENTSECTION#*]"]
UpdateDivider=-1
DynamicVariables=1
X=185
Y=5R
Shows the correct icon, but when copied and pasted gives: [#Icon1]
Upshot is that I can't remove the square brackets without altering more code within the Meters.INC file. It was just a thought to improve the skins usefulness, seems to be proving not possible?
- MuLab -
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Click to copy text?

Post by death.crafter »

sl23 wrote: September 2nd, 2021, 9:04 pm
It's [*[#[#CURRENTSECTION]]*]
from the Realm of Death
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Click to copy text?

Post by sl23 »

Thanks that worked :thumbup:

EDIT: At least, it copies ok, but the issue with empty entries leaves lots of squares for the unknown character as I said before! :-(
- MuLab -
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Click to copy text?

Post by death.crafter »

sl23 wrote: September 2nd, 2021, 10:23 pm Thanks that worked :thumbup:

EDIT: At least, it copies ok, but the issue with empty entries leaves lots of squares for the unknown character as I said before! :-(
What do you mean by empty entries and lots of squares. Why keep empty spaces in the first place?
from the Realm of Death
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Click to copy text?

Post by sl23 »

Each skin has 100 entries 20 on each page. Not all entries are occupied with icons so for example, the first content category has 21 items so fills the first page. On the second page, there is only one icon entry in the list, meaning 19 empty slots .

When the font doesn't recognise a character, it puts a square there instead. At the moment my skin has no text entry for empty slots. But when I change the code to copy the icon text with what's been discussed above, every empty slot has several squares where no icons are present.

The trouble is that the variable being called is blank, so nothing shows on the skin. But using the any code above means every empty variable now has [] so the skin is calling the variable and the font doesn't know what is meant to be displayed and so displays the squares.

Is there any way around this? If not, I'll have to abandon the idea of copying the text.

Thanks for your help.
- MuLab -
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Click to copy text?

Post by death.crafter »

sl23 wrote: September 3rd, 2021, 7:09 am
To every problem, there is always a solution.

CopyIcon.lua

Code: Select all

function SetClip(varName)
	SKIN:Bang('!SetClip', SKIN:GetVariable(varName))
end

Code: Select all

[Variables]
IconN=[\xNinjaCat]

[Clipboard]
Measure=Script
ScriptFile=#@#CopyIcon.lua

[IconN]
...
LeftMouseUpAction=[!CommandMeasure Clipboard "SetClip('#CURRENTSECTION#')"]
; Don't forget the single quotes!
from the Realm of Death
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Click to copy text?

Post by sl23 »

Argh not lua! :lol:

Seriously though, thank you. I'll try it out when I get home.
- MuLab -
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Click to copy text?

Post by death.crafter »

sl23 wrote: September 3rd, 2021, 12:32 pm Argh not lua! :lol:

Seriously though, thank you. I'll try it out when I get home.
Sometimes, lua is your only salvation. ;-)
from the Realm of Death
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Click to copy text?

Post by sl23 »

Oh I know, but still! :o :rofl:
- MuLab -
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Click to copy text?

Post by death.crafter »

sl23 wrote: September 3rd, 2021, 4:34 pm Oh I know, but still! :o :rofl:
Why are you so opposed to lua lmao.
from the Realm of Death