Consistent colors in GUI across systems

1 visualización (últimos 30 días)
Joseph Areeda
Joseph Areeda el 14 de Feb. de 2012
Editada: Cedric el 12 de Oct. de 2013
I'm working on a cross platform GUIDE based application.
My development system is MacOS Lion. When I run the application on that system the GUI looks good (at least to me). However, when I run it on a different version of Matlab or different OS background colors seem to be chosen at random.
If I explicitly set the background color, even to the exact value it shows on my development system it is consistent. But, I have a googol or two widget in this thing.
On MacOS-Snow Leopard, backgrounds are darker (170,170,170 instead of 237,237,237).
On Windows XP, Win 7, Ubuntu 11.04 the button colors are using the "Angry Fruit Salad" color map, some are gray, some are red, yellow, orange, purple and the backgrounds to msgbox are as dark as on Snow Leopard.
Is there any alternative to setting every single background in GUIDE and explicitly modifying each msgbox and other pop-ups?
Thanks, Joe
  1 comentario
Joseph Areeda
Joseph Areeda el 14 de Feb. de 2012
I've been following Sean's advice and editing a lot of buttons. We will see if getting it to look right on Ubuntu affects how it looks on the other systems.
I learned that the rainbow of button colors has something to do with which panel they are in. We highlight the different panels with different colors. It seems some, not all of the buttons are using the parent panel's highlight color as their background color on Ubuntu and Windows but not Macs.
I have no idea who that makes sense to.
Joe

Iniciar sesión para comentar.

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 14 de Feb. de 2012
You could manually set the default colors for the root. This could be dangerous to other applications though:
set(0,'defaultfigurecolor',[0 0 0.6])
etc. Same for uicontrols and others. I would recommend manually doing it in GUIDE though. If you do this and want your original figure color back:
get(0,'defaultfigurecolor');
  3 comentarios
Joseph Areeda
Joseph Areeda el 14 de Feb. de 2012
Oh yeah.
I just took over this project which has been an on going development for years. I'm not sure one person has done the cross platform check and commented on this before.
That's part of my reluctance to go in and modify everything that interacts with the user. It seems very invasive and error prone.
Joe
Sean de Wolski
Sean de Wolski el 14 de Feb. de 2012
I would guess it does, that and themes. Perhaps a good way to dig for it would be to get the default figure (and uicontrol uipanel etc.) color on all three systems - it may have been set by someone else and the OS themes might affect it.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by