It is currently March 29th, 2024, 2:32 pm

Hiding an image when a drive is disconnected

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hiding an image when a drive is disconnected

Post by balala »

sl23 wrote: August 13th, 2019, 8:06 pm I just noticed this! I thought you'd solved it. That's ok I'll look at other ways to use the info. Thanks anyway :thumbup:
Will solve this tomorrow. I'm not working anymore now, because here is almost midnight, but tomorrow will try to get it to work properly.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Hiding an image when a drive is disconnected

Post by sl23 »

balala wrote: August 13th, 2019, 8:28 pm Where? When you create a skin installer, the only thing you have to choose from a dropdown menu, is the config within the Skins folder. there is no need to choose a folder, a file or whatever.
In this case, there is a need to choose a folder. As I needed to upload a skin for you to check. I don't want or need to upload an entire suite for you to check one skin, yet choosing a skin from a suite leaves out the Resources and Addons folders.
Where (again)? There is not possible to select a skin, a config must be selected. It's true the appropriate button is called Add skin, but it adds a config with all of its content, including the @Resources folder.
Nope it doesn't.
1. R-click a skin, select Rainmeter/Manage.
2. Click create .rmskin package.
3. Fill in details and click add skin.
4. Select either Add folder from skins to package an entire suite of skins, ala illustro.
5. Or, select Add custom folder, then browse to folder, click Add.
6. Select where to save, then click Create package.
7. The result, attached below, has a folder from the suite, without the resources or addons folder which are required for the skin to function correctly.
suite_number.rmskin
I still believe it's not needed. Everything contained into the loaded config is included, everything else isn't.
Please reread above, to understand.
How are you creating the skin installers? The process is described in detail here: https://docs.rainmeter.net/manual/distributing-skins/
I did explain, I created the package same as with the attached file using Rainmeter. Then extracted it using WinRAR. Removed unnecessary files from the skin folder, added Resources and Addons folder, then used Windows to compress as a .zip file. Then renamed the extension to .rmskin, thinking it would work. :oops: :?
You do not have the required permissions to view the files attached to this post.
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Hiding an image when a drive is disconnected

Post by sl23 »

balala wrote: August 13th, 2019, 8:38 pm Will solve this tomorrow. I'm not working anymore now, because here is almost midnight, but tomorrow will try to get it to work properly.
Thanks for the offer, but for such a minor thing it's not worth you spending your time on. I really appreciate the offer though, thank you.

The real problem seems to have been lost in the sea of questions and confusion!
How to get SyMenu icon to hide on Startup/Refresh when drive is connected?

Goodnight, thanks for all your time :thumbup: :great:
- MuLab -
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hiding an image when a drive is disconnected

Post by balala »

sl23 wrote: August 13th, 2019, 8:51 pm Thanks for the offer, but for such a minor thing it's not worth you spending your time on. I really appreciate the offer though, thank you.
As you wish. Take a look here, a similar question has been answered there: https://forum.rainmeter.net/viewtopic.php?f=5&t=30850&p=157279&hilit=autoscale+calc+measure#p157279
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hiding an image when a drive is disconnected

Post by balala »

sl23 wrote: August 13th, 2019, 8:51 pm How to get SyMenu icon to hide on Startup/Refresh when drive is connected?
Are you talking about this?
sl23 wrote: August 13th, 2019, 8:51 pm EDIT: I just had an idea which I tried and got halfway there! :D
I added a command to change the name of the Group=Hover to Group=H. This has disabled the Hover when disconnected. So now I'm getting this...
With E Drive connected:
1. Connect Drive or Refresh Skin = SyMenu image shows. Should be hidden.
2. MouseOver skin = SM image still visible and Recycle Bin shows next to it. Correct.
3. MouseLeave = Both images hide as expected. Correct.
With E Drive disconnected:
1. Connect Drive or Refresh Skin = SyMenu image hidden. Correct.
2. MouseOver skin = SM image visible and Recycle Bin shows next to it. Should just be RB, SM should be hidden.Now works correctly.
3. MouseLeave = Both images hide as expected. Correct.
If you are, I don't agree. According to your description, it seems the only problem is at point 1, when the drive is connected. But if you refresh the skin with drive connected, the SyMenu image isn't shown. It simply isn't visible. It is, ONLY if the mouse is over the skin, otherwise it isn't.
Is this a problem? You'd like to get it hidden even if the mouse is over the skin?
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Hiding an image when a drive is disconnected

Post by sl23 »

Hi balala, yes, that's what I'm referring to.

But there's a misunderstanding regarding the issue.
It works fine, except under two circumstances, either plugging the drive in or refreshing the skin.
Ok here's what happens...
1. Drive unplugged and no SyMenu icon.
2. Now plug the drive in and the skin updates with the info regarding drive connection.
3. The trouble is that the icon is shown with the drive info overlaid onto it. The icon should be hidden.
4. If I then hover over the skin, it hides the icon and from then on works as expected.

It's exactly the same when refreshing the skin with the drive connected. Every refresh brings back the icon until you hover the skin.

Is there a way to stop this? If it's too complex I'll do something else, like reduce it's size or something.

Thanks.
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Hiding an image when a drive is disconnected

Post by sl23 »

I did take a look at that link, but tbh, formulas are beyond me! If I could spend the time to learn them I probably be ok with it, but it's motivation to do so. So don't worry about that one, thank you.
- MuLab -
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hiding an image when a drive is disconnected

Post by balala »

sl23 wrote: August 14th, 2019, 10:30 pm But there's a misunderstanding regarding the issue.
It works fine, except under two circumstances, either plugging the drive in or refreshing the skin.
Yep, right, now I see.
Here is a solution: first we'll need to add a new variable, let's name it Start. Add it to the [Variables] section, beside the existing variables:

Code: Select all

[Variables]
...
Start=0
As you see its value is initially 0, then we update it to 1 when you're hovering the mouse over the skin. For this add two new bangs ([!SetVariable Start "1"] and [!UpdateMeasure "MeasureETotal"]) to the MouseOverAction option of the [Rainmeter] section:

Code: Select all

[Rainmeter]
...
MouseOverAction=[!SetVariable Start "1"][!ShowMeterGroup Hover][!UpdateMeterGroup *][!SetOption VolLabel Y "10R"][!SetOption Time FontColor "128,255,0"][!UpdateMeasure "MeasureETotal"][!UpdateMeter *][!Redraw]
The [MeasureETotal] measure will be added immediately, it doesn't exist yet (see below).
Remove the [!ShowMeter "SyMenu"] and [!HideMeter "SyMenu"] bangs from the IfTrueAction and IfFalseAction options of the [mETotal] measure:

Code: Select all

[mETotal]
...
IfTrueAction=[!SetOptionGroup "Disk-E" Y "0R"][!SetOption SyMenu Group "H"][!HideMeterGroup "Disk-E"][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetOptionGroup "Disk-E" Y ""][!SetOption SyMenu Group "Hover"][!ShowMeterGroup "Disk-E"][!UpdateMeter *][!Redraw]
And finally add the previously promised [MeasureETotal] measure, which was updated into the MouseOverAction option of the [Rainmeter] section:

Code: Select all

[MeasureETotal]
Measure=Calc
Formula=( #Start# * mETotal )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "SyMenu"][!Redraw]
IfFalseAction=[!ShowMeter "SyMenu"][!Redraw]
DynamicVariables=1
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hiding an image when a drive is disconnected

Post by balala »

sl23 wrote: August 14th, 2019, 10:38 pm I did take a look at that link, but tbh, formulas are beyond me! If I could spend the time to learn them I probably be ok with it, but it's motivation to do so.
No, they are not as complicated as they seem.
For instance, let's take this measure:

Code: Select all

[MeasureTotalDiskSpaceScaled]
Measure=Calc
Formula=(( MeasureTotalDiskSpace > ( 1024 ** 3 )) ? ( MeasureTotalDiskSpace / ( 1024 ** 3 )) : (( MeasureTotalDiskSpace > ( 1024 ** 2 )) ? ( MeasureTotalDiskSpace / ( 1024 ** 2 )) : (( MeasureTotalDiskSpace > 1024 ) ? ( MeasureTotalDiskSpace / 1024 ): MeasureTotalDiskSpace )))
This measure is used to scale the value returned by the [MeasureTotalDiskSpace] measure. The formula checks at first step if the value of the [MeasureTotalDiskSpace] measure is higher then 10243 (written as ( 1024 ** 3 )). If it is, it divides the value of the measure with 10243, getting this way the result as a number less then 1024. So, this time the value of the [MeasureTotalDiskSpaceScaled] measure will be expressed as a number less then 1024 (so in GB). In this case the rest of the formula doesn't matter, it's not used.
If the previously made check is false (so the value of the [MeasureTotalDiskSpace] measure is less then 10243), a new checking is done: the formula checks now if the value is higher then 10242 (or ( 1024 ** 2 )). If it is, the value of the measure is divided by 10242, getting the result expressed into MB (with a number less then 1024).
If nor this condition doesn't prove to be true, a new compareson is done: the value of the [MeasureTotalDiskSpace] measure is compared with 1024. If its value is higher then 1024, it is divided by 1024 (getting the result in KB), otherwise it is returned as it is (in which case it is expressed into bytes).
These steps are needed to scale the value of the [MeasureTotalDiskSpace] measure. Don't be afraid of it, it's not as complicated as it seems at a first look.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Hiding an image when a drive is disconnected

Post by sl23 »

Wow! Thank you so much for fixing that problem :thumbup: :thumbup: :thumbup: :D

I see your formula example explanation and it's very good. But the issue is with understanding the syntax used.
Imagine a non programmer coming to Rainmeter for the first time with no manual or guidance from the forum!
That's what it's like trying to understand formulas! O.O
- MuLab -