-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented a theme switcher feature #62
Conversation
…le back to try and remove the file extension, forgot to remove it. Removed....
…llocaded using calloc
…s users to modify the boxes that surrounds the menu entries
:) Remove the *bin.h files. |
Makefile
Outdated
@@ -2,7 +2,7 @@ export APP_VERSION := 2.0.0 | |||
|
|||
.PHONY: clean all nx pc dist-bin | |||
|
|||
all: nx pc | |||
all: nx pc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
Also, have you guys though of using this? it is completely free for open source and public repositories! |
is this meant for me? im confused lol |
referring to "Also, have you guys though of using this?" |
common/theme.c
Outdated
@@ -74,10 +91,9 @@ void themeStartup(ThemePreset preset) { | |||
case THEME_PRESET_DARK: | |||
themeDefault = &themeDark; | |||
if (good_cfg) | |||
theme = config_lookup(&cfg, "darkTheme"); | |||
theme = config_lookup(&cfg, "darkTheme"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra whitespace
Remove the "(old)" files. |
|
Whatever, as long as no setup-commits are pushed to this branch. |
common/menu-entry.c
Outdated
//Todo load in the data about the theme? | ||
//Add a theme name property to each one? | ||
//Ability to load the theme as you hover over? | ||
free((void*)name);//This was allocated by calloc and copied over by strcpy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't free that here, do it in the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IM AN IDIOT.... you mean free it in the area i created it.... gotcha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That really doesn't need to be on the heap, should be a stack buffer in themeMenuScan.
coolio :) ill do that after this branched is fixed up and ready to merge |
…that called it, now it is easier to track when its freed
found a bug, you can enter the theme menu while in netloader without properly backing out... causing it to not properly exit. |
…r menu, without properly exiting
common/theme.c
Outdated
@@ -49,20 +67,19 @@ void themeStartup(ThemePreset preset) { | |||
char tmp_path[PATH_MAX] = {0}; | |||
|
|||
#ifdef __SWITCH__ | |||
tmp_path[0] = '/'; | |||
tmp_path[0] = '/';/*will this work on the windows version?*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it will. A common misconception is that Windows only accepts \. That is false, Windows accepts both \ and /.
common/theme.c
Outdated
.enableWaveBlending = 0, | ||
.buttonAText = "\uE0E0", | ||
.buttonBText = "\uE0E1", | ||
.buttonAText = buttonAText,/*setting the buttonAText = "\uE0E0" directly allocates the literal on the stack */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The claim in this comment is false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmmm, then what exactly does it do? when i googled it this was the conclusion that i came too... and i talked to my other coworkers about this as well and they thought the same thing.
i got the light theme minus and plus buttons wrong... i thought A->B in dark would be E->F in light... |
Don't add anything for +. |
common/menu.c
Outdated
if(hbmenu_state == HBMENU_THEME_MENU) { | ||
DrawText(interuiregular18, getX, 0 + 47, themeCurrent.textColor, textGetString(StrId_ThemeMenu)); | ||
} else { | ||
DrawText(interuiregular18, getX, 0 + 47, themeCurrent.textColor, textGetString(StrId_ThemeMenu)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment out these two lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you dont like it? :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah just disable for now, can figure out what to do with it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i cant find the minus button for the light theme.... weird. are we using the built in font for the switch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i am commenting them out and about to commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a file that shows all of the characters and their unicode numbers? i might try creating one of those....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to load the shared-font with some font tool.
do you want me to get rid of the plus button text in theme.c? |
You can leave that. |
One more thing... is it just SX OS that keeps it from working? or is netloader just not fully implemented currently? |
Wut, netloader works fine... |
hmmmmm..... could you compile my code and see if netloader works on your switch? i dont think i modified anything to make netloader not work.... i use SX OS, and when i press Y, nothing happens... the screen just stays blank foreva |
It's supposed to display a screen with no apps when netloader is active. |
oh.... then i am totally confused as to what it is used for LOL |
found a bug... pressing A while in netloader... crashes the switch (at least it crashed mine) |
Can't repro, although button A handling could be disabled later for that. Waiting on newline fix before merge... |
what newline fix? |
it only showed one newline on my pc, but i got rid of the one.. now there is none... let me know if i need to add it back..... |
Undo that, I mean this: https://github.com/switchbrew/nx-hbmenu/pull/62/files#diff-fddcee21e62e3b656dcc5fb9af2e7c9bR169 |
ok... so i keep clicking this link and i have no idea what you are talking about... you want me to add a newline or remove one? are you talking about a newline before the if in the menuAddEntryToFront? |
Remove the newline right before themeMenuScan. |
:) |
Merge time!? 💃 |
yes |
So after seeing friedkeenen on reddit implement theming and you guys accept it into your guys code i was inspired to modify and implement something myself!
I was able to modify the code and add a menu that will replace the homebrew menu with a theme switcher menu whenever the minus button is pressed on the switch. This allows the users the ability to download a large list of themes, placing them in the theme folder and change the theme of their homebrew menu whenever they would like instead of having to go on a pc, or use a separate homebrew application to change the theme.cfg file.
This is what the theme menu looks like