B4J Question Change the title and color of the title bar

T201016

Active Member
Licensed User
Longtime User
I'm going to change the title and color of the title bar, what am I doing wrong?

1. How can I change the title for the 'MainPage' bar (see file: S0.png)
2. How can I replace the light to dark color for the 'MediaView' (see file: S1.png)

I will be grateful in advance for the tips. Greeting.

 

Attachments

  • B4XPages.zip
    6.9 KB · Views: 24
Solution
It works if you explicitly set the darkmode to the PageMediaView after it is displayed, may need tweaking if you do anything else with the page.

In Main.Button1_Click add the last line:

B4X:
        B4XPages.MainPage.pg.pth = File.GetFileParent(ffplay)
        B4XPages.MainPage.pg.filename = File.GetName(ffplay)
        B4XPages.ShowPage("PageMediaView")
        DarkTitleBar.SetDarkMode(B4XPages.GetNativeParent(B4XPages.GetPage("PageMediaView")),True)

It needs setting for each new page.

zed

Well-Known Member
Licensed User
You have two options.
Either you use MainForm.SetFormStyle("UNDECORATED") and create the title bar yourself,
or you can use this:
I don't know if it's possible to change the title color with this class.
 
Upvote 0

T201016

Active Member
Licensed User
Longtime User
I used the method you mentioned in my example. For forms it's simple, but for B4XPages it doesn't work.
 
Upvote 0

zed

Well-Known Member
Licensed User
Could you provide a code example that demonstrates the problem?
It will be easier to see what's wrong.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It works if you explicitly set the darkmode to the PageMediaView after it is displayed, may need tweaking if you do anything else with the page.

In Main.Button1_Click add the last line:

B4X:
        B4XPages.MainPage.pg.pth = File.GetFileParent(ffplay)
        B4XPages.MainPage.pg.filename = File.GetName(ffplay)
        B4XPages.ShowPage("PageMediaView")
        DarkTitleBar.SetDarkMode(B4XPages.GetNativeParent(B4XPages.GetPage("PageMediaView")),True)

It needs setting for each new page.
 
Last edited:
Upvote 1
Solution

T201016

Active Member
Licensed User
Longtime User
Could you provide a code example that demonstrates the problem?
It will be easier to see what's wrong.
The demo example attached to the post (B4XPages.zip) shows my problem. I also wanted to get a dark title color for the MediaView window. Currently you only see a dark background for the title in MainPage. @stevel05 suggestion is right, it made me realize that the settings should be made for each new page. Now everything is clear, you can close the resolved topic - thanks for your response and help
 
Reactions: zed
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…