Change Text Color in Header Bar...

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tj333
Posts: 12
Joined: Sat Jun 25, 2016 11:46 am

Change Text Color in Header Bar...

Post by tj333 » Wed Jun 29, 2016 5:50 am

I used the Header Bar today and it works great. For my color scheme I was hoping to have a black background on the header bar with white text. However it did not appear that there was an option to change the text color.

Recently I was using rectangles and they have the option to show the name, but again it didn't allow me to change the color of text. Is there a way to do this, or would I have to just kinda make my own header bar/rectangles if I want white text?

Thanks for any suggestions or ideas,

TJ.

***Also is it possible to center Title text in the headerbar as I am setting the title on openCard so I cannot know the length in advance. I suppose it would be possible to write code to buffer the Title with spaces depending on its length, but around that point I start wondering if I should just make my own.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Change Text Color in Header Bar...

Post by Klaus » Wed Jun 29, 2016 1:22 pm

Hi TJ,

not sure what the problem is? :shock:

1. In the inspector I can set:
backgroundcolor -> black
foregroundcolor (color of label) -> white
hilitecolor (text and icons on left and right side) -> whatever I like

2. The label text is always centered!

Using LC 8.01 on a Mac.


Best

Klaus

tj333
Posts: 12
Joined: Sat Jun 25, 2016 11:46 am

Re: Change Text Color in Header Bar...

Post by tj333 » Wed Jun 29, 2016 11:26 pm

Thank you for your reply Klaus!

I was able to set the text color from colors tab, for some reason I was looking for it in the text tab, duh!

However when I enter text as the Title/Label of the Header Widget it is not centered and always appears left justified.

I can add spaces in front of the Title text to pad the entry and center the text myself, but I want to sometimes set the Title text based on user input so it would be unpredictable. I know it would be possible to check the length of the input and pad the text accordingly, but I was hoping there was an easier way.

I am using 8.0.1 on WinDoze 7. Maybe its different on Windows than Mac?

Thanks again for your advice,

TJ.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Change Text Color in Header Bar...

Post by Klaus » Thu Jun 30, 2016 10:49 am

Hi tj,
tj333 wrote:I am using 8.0.1 on WinDoze 7. Maybe its different on Windows than Mac?
hm, maybe...
Will check this later on my virtual Windows 10!


Best

Klaus

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Change Text Color in Header Bar...

Post by Klaus » Thu Jun 30, 2016 12:41 pm

Yep, confirmed on Windows 10!
I consider this a bug and will create a report!

Done: http://quality.livecode.com/show_bug.cgi?id=17923

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Change Text Color in Header Bar...

Post by Klaus » Thu Jun 30, 2016 1:21 pm

Hi tj,

sorry, but this is not a bug, here the reply from the mothership to my bug report:
On Windows and Linux, the header bar uses the Android theme by default.
On OS X, it uses the iOS theme by default. The behaviour you describe is intentional.
Best

Klaus

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Change Text Color in Header Bar...

Post by Klaus » Thu Jun 30, 2016 1:44 pm

Hi tj,

after diging a bit deeper, it turns that you can set the THEME of the widget to something different, see the dictionary!
On Windows try this, maybe on preopencard, since the THEME is NOT saved with the stack!
...
set the theme of widget "your header bar here..." to "iOS"
...

Best

Klaus

tj333
Posts: 12
Joined: Sat Jun 25, 2016 11:46 am

Re: Change Text Color in Header Bar...

Post by tj333 » Sat Jul 02, 2016 2:24 am

Wow, thanks Klaus. That's a lot of information! I will try working with the theme as you suggested.

Thank you for your help!

TJ.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”