Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 08-15-2019, 01:10 PM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default API: gfx-functions for loading/resizing theme-images

This has been on my mind for a while and maybe, this fits into the overhaul of Reaper's theme-stuff.

When I write scripts and I want to add a gui, I would love to make my gui as "compatible" to the style of the current theme as possible, which means, using the theme's colors and pictures.

The former is easy, the latter not, as themes are often stored as zip-files, not accessible with gfx.loadimg.

So here are some ideas, how to make loading and working with a theme's own images work.

1) string theme, integer width, integer height = gfx.loadthemeimg(integer image, string themeelement)

This loads an image from a theme. themeelement should be either the themeelement, as used by Walter or the dirctorystructure in the ReaperThemeZip-file/uncompressed theme-image-folder, whatever suits the needs best.
If no theme is loaded, it loads the 1.x-images instead.

2) gfx.resize_themeimage(integer image, integer newwidth, integer newheight)

This resizes the image, according to Walter's stretching-area-rules. That way, we could avoid distorted versions of button-images and resize them, like any other Walter-based-theme.
You know, the yellow and pink areas.

3) boolean retval = gfx.has_theme_changed()
This returns, if the theme has been changed/reloaded since last time calling this function within this script/deferred script.
If this returns true, I need to reload the images in my script to fit the style of the currently selected theme.

With these three functions, we could easily use theme-images in our scripts and create even more consistent layouts within Reaper in our guis. Would look very neat in Reaper 6, I think
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 08-16-2019, 08:51 AM   #2
Klangfarben
Human being with feelings
 
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
Default

Big +1 for this!
Klangfarben is offline   Reply With Quote
Old 11-08-2019, 10:21 AM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

+Gazilion

I have ideas for Lokasenna's new v3-GuiLib and this would allow them.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-08-2019, 10:43 AM   #4
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

I've asked for this before, so +1 again.

@mespotine - I think I have the same idea for my GUI. "Process Reaper theme images" is somewhere in my list of issues.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 11-08-2019, 10:59 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Yes, this would be awesome. Guis with graphical buttons of the currently selected theme would look real neat!
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-31-2020, 04:53 PM   #6
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

To boldly bump, where no bump has bumped before.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.