r23340 - Support skinned titlebar for main window
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
41 posts
• Page 1 of 3 • 1, 2, 3
r23340 - Support skinned titlebar for main window
by drdev » 29 Sep 2013, 07:08
So something I've been wanting to do for awhile was eliminate the standard OS window titlebar and resize border from the main window. After taking the time to support switching skins without restart, I felt this was a good time.
Please note that you can almost everything you could do with the standard OS titlebar, with buttons for minimize, maximize, and close, double-click to maximize/restore, as well as being able to grab the window border to resize (when not maximized). It's also worth noting that maximize is now full-screen instead of showing the taskbar, so it will feel a bit more like a game that way.
The next step I want to do is to add screen tabs to this titlebar to make navigating between the Home screen, Deck Editor, Game screen, and eventually the screen for creating/editing cards I want to add. Maybe we can even support having multiple games at once unless it's too much of a memory hog.
Here's a screenshot of what the new skinned titlebar looks like when not maximized. Let me know what you think or if you have any questions.
Thanks.
-Dan
Please note that you can almost everything you could do with the standard OS titlebar, with buttons for minimize, maximize, and close, double-click to maximize/restore, as well as being able to grab the window border to resize (when not maximized). It's also worth noting that maximize is now full-screen instead of showing the taskbar, so it will feel a bit more like a game that way.
The next step I want to do is to add screen tabs to this titlebar to make navigating between the Home screen, Deck Editor, Game screen, and eventually the screen for creating/editing cards I want to add. Maybe we can even support having multiple games at once unless it's too much of a memory hog.
Here's a screenshot of what the new skinned titlebar looks like when not maximized. Let me know what you think or if you have any questions.
Thanks.
-Dan
Last edited by drdev on 29 Sep 2013, 19:33, edited 1 time in total.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: r23340 - Support skinned titlebar for main window
by moomarc » 29 Sep 2013, 07:44
This makes me very happy. Thanks!
-Marc
-

moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: r23340 - Support skinned titlebar for main window
by Diogenes » 29 Sep 2013, 16:36
My first impression is overwhelmingly positive. It seems to be a pretty seamless transition, everything has been well-behaved in maximized and windowed mode (Forge looks fantastic in full-screen!) Great work!
The only change that adversely affects me as a user is losing the clock from my task bar. Is it possible to display the system time in the title bar?
The dark blue window border distracts me by not actually being black (I'm easily distracted.)
Lastly, does the new title bar make it easy to separate the "return to previous screen" and "quit program" functions into two separate buttons? I honestly have no idea, but if it is super easy I'd vote for it. (If it's not then ignore this one, I don't mean to be demanding. ^_^)
I'm a big fan of the new look. Awesome work Dan!
The only change that adversely affects me as a user is losing the clock from my task bar. Is it possible to display the system time in the title bar?
The dark blue window border distracts me by not actually being black (I'm easily distracted.)
Lastly, does the new title bar make it easy to separate the "return to previous screen" and "quit program" functions into two separate buttons? I honestly have no idea, but if it is super easy I'd vote for it. (If it's not then ignore this one, I don't mean to be demanding. ^_^)
I'm a big fan of the new look. Awesome work Dan!
Re: r23340 - Support skinned titlebar for main window
by drdev » 29 Sep 2013, 18:01
So a quick update. I fixed the titlebar to display the proper Forge icon. I also added support for using Layout > View > Titlebar (F11) to toggle the visibility of the titlebar, so combined with hiding the menu bar using F1 you can actually have true full-screen Forge. Note that hiding the titlebar this way will automatically maximize the window since it will only support being hidden in full-screen mode.
Diogenes, I chose the dark blue because I didn't like the look of black, but I'm open to changing it or making it configurable. Ideally I'd like to make the border look more like the standard OS border anyway, though I haven't figured out how to do that.
In terms of previous screen vs. quit, my plan is to add tabs for each screen to the titlebar, which you'll be able to use to switch screens instead of using the X button. I'll then make the X button actually exit Forge (with a prompt if not on the home screen to ease the transition).
As for showing the time, I can definitely add that somewhere, though should I hide it if not in full-screen mode?
Diogenes, I chose the dark blue because I didn't like the look of black, but I'm open to changing it or making it configurable. Ideally I'd like to make the border look more like the standard OS border anyway, though I haven't figured out how to do that.
In terms of previous screen vs. quit, my plan is to add tabs for each screen to the titlebar, which you'll be able to use to switch screens instead of using the X button. I'll then make the X button actually exit Forge (with a prompt if not on the home screen to ease the transition).
As for showing the time, I can definitely add that somewhere, though should I hide it if not in full-screen mode?
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: r23340 - Support skinned titlebar for main window
by spr » 29 Sep 2013, 19:16
Thanks Dan! This is an excellent update - it is amazing how much extra room there seems to be now once you F11, F1 and CTRL-T. Keeping the menu accelerators active by shrinking instead of hiding the menu is also really helpful.
Could you make the titlebar autohide/appear if the mouse cursor moves somewhere near the top edge of the screen since it does contain the quit/navigate functionality and most users will expect this. This would also work well when you tabify it.
Cheers,
Steve
Could you make the titlebar autohide/appear if the mouse cursor moves somewhere near the top edge of the screen since it does contain the quit/navigate functionality and most users will expect this. This would also work well when you tabify it.
Cheers,
Steve
Re: r23340 - Support skinned titlebar for main window
by drdev » 29 Sep 2013, 19:39
Alright, I added a digital clock that displays in the titlebar when in full-screen mode. Let me know if I should add any configuration for the time format or support for showing the time when the titlebar is hidden.
I also updated the re-sizable main window border so it uses an outer 1 pixel black border and an inner 2 pixel skinned border that updates based on the CLR_BORDERS color. I think the result looks better than the 3 pixel wide dark blue border I had before (see OP for updated screenshot).
spr, I was planning to add support for showing the titlebar if the mouse is at the very top of the screen, which is similar to how other programs deal with full-screen mode. In this case, I would display a pin icon next to the minimize icon that would allow it to not be hidden automatically when moving the mouse away.
Should we maybe add a button to the titlebar that toggles the visibility of the menu bar?
I also updated the re-sizable main window border so it uses an outer 1 pixel black border and an inner 2 pixel skinned border that updates based on the CLR_BORDERS color. I think the result looks better than the 3 pixel wide dark blue border I had before (see OP for updated screenshot).
spr, I was planning to add support for showing the titlebar if the mouse is at the very top of the screen, which is similar to how other programs deal with full-screen mode. In this case, I would display a pin icon next to the minimize icon that would allow it to not be hidden automatically when moving the mouse away.
Should we maybe add a button to the titlebar that toggles the visibility of the menu bar?
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: r23340 - Support skinned titlebar for main window
by friarsol » 30 Sep 2013, 03:40
I don't really like this change. When I play Forge, I'm usually multitasking three or four other things, but this covers over my Start Bar, so I can't really get back to things without being in not quite maximized mode, which I find kind of annoying.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: r23340 - Support skinned titlebar for main window
by Max mtg » 30 Sep 2013, 05:12
I totally like the new clock at titlebar. Would you improve it to take into consideration the local time settings, that is use 24-hour format if it is set as default in OS?
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: r23340 - Support skinned titlebar for main window
by spr » 30 Sep 2013, 05:20
I would prefer if it adhered to my system format which is 24 hour. And if the time was centered in the title bar (v. minor). It is useful though.drdev wrote:Alright, I added a digital clock that displays in the titlebar when in full-screen mode. Let me know if I should add any configuration for the time format or support for showing the time when the titlebar is hidden.
Sounds good.drdev wrote:spr, I was planning to add support for showing the titlebar if the mouse is at the very top of the screen, which is similar to how other programs deal with full-screen mode. In this case, I would display a pin icon next to the minimize icon that would allow it to not be hidden automatically when moving the mouse away.
Up to you but remember the KISS principle. On the subject of the menubar I would prefer it if it was slightly larger in height - it seems a bit cramped and constricted.drdev wrote:Should we maybe add a button to the titlebar that toggles the visibility of the menu bar?
How about if the first time you maximize, it is a normal maximize that obeys the desktop constraints (taskbar, desktop appbars, etc) and then if you click maximize again it goes full screen. That would make full screen optional without actually requiring an explicit setting.friarsol wrote:I don't really like this change. When I play Forge, I'm usually multitasking three or four other things, but this covers over my Start Bar, so I can't really get back to things without being in not quite maximized mode, which I find kind of annoying.
Cheers,
Steve
Re: r23340 - Support skinned titlebar for main window
by friarsol » 30 Sep 2013, 12:08
That might work, does that mean you'll have to add a fourth button? Or just have the Maximize button run through three settings?spr wrote:How about if the first time you maximize, it is a normal maximize that obeys the desktop constraints (taskbar, desktop appbars, etc) and then if you click maximize again it goes full screen. That would make full screen optional without actually requiring an explicit setting.
Usually there's three buttons, Minimize, Normalize/Maximize (depending on state), and Close. But there it would be: Minimize, Normalize/Maximize/Full Screen (depending on state, and Close. Or Minimize, Normalize, Maximize/Full Screen (depending on state), and close.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: r23340 - Support skinned titlebar for main window
by drdev » 30 Sep 2013, 12:57
For using your computers time format, I couldn't find a cross browser solution. I could do it for Windows by accessing HKEY_CURRENT_USER\Control Panel\International\sTimeFormat, but that doesn't seem to directly translate to the time format options Java supports given Windows uses "tt" for AM/PM vs Java using "a" for example. How about just making it configurable in preferences?
As for maximize doing full-screen, that's wasn't intentional on my part, but rather a side-effect of using an undecorated JFrame. I thought it was nice if anything, so I called it a feature rather than a bug. If others would prefer the taskbar still be visible when maximized, or at least have that option, I can try out the workaround here. I could then add a full-screen option to the View menu that uses F11 instead of the current behavior of just hiding the titlebar, and that full-screen option could auto-hide the titlebar and we'd have the drop down when mouse at top of screen solution to access it. Though we might want to move the clock in that case.
spr, as for centering the time, my hope was to support navigation tabs for each screen on the titlebar, so centering the time wouldn't really work. Is that ok?
As for maximize doing full-screen, that's wasn't intentional on my part, but rather a side-effect of using an undecorated JFrame. I thought it was nice if anything, so I called it a feature rather than a bug. If others would prefer the taskbar still be visible when maximized, or at least have that option, I can try out the workaround here. I could then add a full-screen option to the View menu that uses F11 instead of the current behavior of just hiding the titlebar, and that full-screen option could auto-hide the titlebar and we'd have the drop down when mouse at top of screen solution to access it. Though we might want to move the clock in that case.
spr, as for centering the time, my hope was to support navigation tabs for each screen on the titlebar, so centering the time wouldn't really work. Is that ok?
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: r23340 - Support skinned titlebar for main window
by spr » 30 Sep 2013, 13:18
Trydrdev wrote:For using your computers time format, I couldn't find a cross browser solution. I could do it for Windows by accessing HKEY_CURRENT_USER\Control Panel\International\sTimeFormat, but that doesn't seem to directly translate to the time format options Java supports given Windows uses "tt" for AM/PM vs Java using "a" for example. How about just making it configurable in preferences?
- Code: Select all
DateFormat.getTimeInstance().format(Calendar.getInstance().getTime())
Wow - I thought it would be easier than that.drdev wrote:As for maximize doing full-screen, that's wasn't intentional on my part, but rather a side-effect of using an undecorated JFrame. I thought it was nice if anything, so I called it a feature rather than a bug. If others would prefer the taskbar still be visible when maximized, or at least have that option, I can try out the workaround here. I could then add a full-screen option to the View menu that uses F11 instead of the current behavior of just hiding the titlebar, and that full-screen option could auto-hide the titlebar and we'd have the drop down when mouse at top of screen solution to access it. Though we might want to move the clock in that case.
In the grand scheme of things I can probably live with it!drdev wrote:spr, as for centering the time, my hope was to support navigation tabs for each screen on the titlebar, so centering the time wouldn't really work. Is that ok?
Cheers,
Steve
Last edited by spr on 30 Sep 2013, 13:49, edited 1 time in total.
Re: r23340 - Support skinned titlebar for main window
by Diogenes » 30 Sep 2013, 13:35
I'm really digging the refinements, drdev!
The new border looks great, it really separates Forge from any other open windows. Thanks also for adding the clock!
spr, you mentioned wanting more vertical space for the menu bar items. Since the title bar can now be hidden during full-screen play, enlarging it wouldn't take away any play-space from users who want to use their entire display, and windowed users can resize as they like. Would something like this work with your plans for the menu bar?
Edit: I got super-ninja'd on the task-bar / full-screen thing. Oops.
Again, you guys are awesome! You're making me want to learn Java so that I can do something cool too.
The new border looks great, it really separates Forge from any other open windows. Thanks also for adding the clock!
Would it be possible to simply merge the drop down menus from the menu bar into the title bar, just to the left of the program version? Currently both bars are using a small portion of their available horizontal space, even at minimum playable resolution. I'm not sure how much space the navigational tabs will need (I pictured browser-sized tabs, not icons,) but it might all still fit. If it's possible, it would simplify the UI, save space, and reduce the number of shortcuts for users.drdev wrote:Should we maybe add a button to the titlebar that toggles the visibility of the menu bar?
spr, you mentioned wanting more vertical space for the menu bar items. Since the title bar can now be hidden during full-screen play, enlarging it wouldn't take away any play-space from users who want to use their entire display, and windowed users can resize as they like. Would something like this work with your plans for the menu bar?
Edit: I got super-ninja'd on the task-bar / full-screen thing. Oops.
Again, you guys are awesome! You're making me want to learn Java so that I can do something cool too.
Re: r23340 - Support skinned titlebar for main window
by spr » 30 Sep 2013, 14:00
Personally, I think it is better to keep a separate menu bar since it is a common and well understood concept. We are only talking aboutDiogenes wrote:Would it be possible to simply merge the drop down menus from the menu bar into the title bar...
spr, you mentioned wanting more vertical space for the menu bar items...
Cheers,
Steve
Re: r23340 - Support skinned titlebar for main window
by drdev » 30 Sep 2013, 14:20
The reason I lowered it to 22, in addition to wanting the titlebar and menu bar to be the same height, is so that the menu items themselves would be the same height as the menu bar.spr wrote:Personally, I think it is better to keep a separate menu bar since it is a common and well understood concept. We are only talking aboutDiogenes wrote:Would it be possible to simply merge the drop down menus from the menu bar into the title bar...
spr, you mentioned wanting more vertical space for the menu bar items...2622 pixels after all. Plus you can always hide it with F1. Regarding the menu height, I just prefer a bit more padding!
Cheers,
Steve
That said, I think I have a workable solution. What if I converted the icon and "Forge" part of the title into a button, which, when clicked, would show the menus (besides the current Forge menu) in a single drop down menu as submenus (with the Restart and Exit Forge items being below a separator in that drop down). Something like this:
Game >
Dev >
Layout >
Help >
------
Restart Forge
Exit Forge
That way, it wouldn't take up any more horizontal space on the titlebar and we could eliminate the menu bar and F1 shortcut completely. I would also increase the titlebar to 26 pixels tall if I did this.
As an added bonus, I think getting rid of the menu bar would further push Forge away from looking like a standard Windows application, which I think is a good thing.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
41 posts
• Page 1 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 13 guests