Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 What's SelectionImages ? How do I see it's wrong ? Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 (edited) Forgot this post Edited April 2, 2020 by Jief_Machak Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 Is this XImage TopImage = ThemeX.SelectionImages[((Entry->Row == 0) ? 0 : 2) + (selected ? 0 : 1)]; should be XImage TopImage = ThemeX.SelectionImages[((Entry->Row == 0) ? 0 : 2) + (selected ? 1 : 0)]; Link to comment Share on other sites More sharing options...
Slice Posted April 2, 2020 Share Posted April 2, 2020 Selection[0] is selected, Selection[1] is just empty image. So it is the same as XImage TopImage; if (selected) { TopImage = ThemeX.SelectionImages[((Entry->Row == 0) ? 0 : 2)]; } Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 Ok, so that means you get empty image when it's not selected ? XImage TopImage = ThemeX.SelectionImages[((Entry->Row == 0) ? 0 : 2) + (selected ? 0 : 1)]; Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 I don't know what are selectionImages. What do they look like ? Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 Oh, there are the main icons, right ? Link to comment Share on other sites More sharing options...
Slice Posted April 2, 2020 Share Posted April 2, 2020 18 minutes ago, Jief_Machak said: I don't know what are selectionImages. What do they look like ? Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 The arrow on top ? But in the version I compile, I don't even have the main images (os icons). Link to comment Share on other sites More sharing options...
Slice Posted April 2, 2020 Share Posted April 2, 2020 3 minutes ago, Jief_Machak said: The arrow on top ? But in the version I compile, I don't even have the main images (os icons). Because of mistakes. If you compile with USE_XTHEME=0 then you will see full picture. I hope you will point me my mistakes. Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 In gdb, SelectionImages[0] is still well initialized when we are at menu.cpp:4493, but I added a ThemeX.SelectionImages[0].Draw(0, 0); and I have a black rounded square. Is it an alpha problem ? Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 The data seems to be there, in ThemeX.SelectionImages. I printed the six images and I got: So ThemeX.SelectionImages[4] is fine, but not the other... Link to comment Share on other sites More sharing options...
Slice Posted April 2, 2020 Share Posted April 2, 2020 XImage.Draw() tested. May be there is a size problem. Or XImage[0] is impossible. Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 Got something. Wait a sec. Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 2, 2020 Author Share Posted April 2, 2020 Done. Arrows are back. 1 Link to comment Share on other sites More sharing options...
Slice Posted April 3, 2020 Share Posted April 3, 2020 6 hours ago, Jief_Machak said: Done. Arrows are back. Good lesson! Link to comment Share on other sites More sharing options...
Slice Posted April 4, 2020 Share Posted April 4, 2020 I am near at final cut with XTHEME refactoring. The differences: 1. Dragon came back. 2. Menu is over banner Bugs still remaining 1. Icon "option" is daylight while it must be night in this case. 2. Mouse artefacts. 3. No buttons scrolling 4. Wrong Main icons. (not on this screenshot) something else? Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 4, 2020 Author Share Posted April 4, 2020 I moved menu.cpp (now it's REFIT_MENU_SCREEN.cpp). Before sure to pull before modifications. Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 4, 2020 Author Share Posted April 4, 2020 Hum, that wasn't really want I've planned. I'm fixing it. Wait a sec to modify menu.cpp or REFIT_MENU_SCREEN.cpp... Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 4, 2020 Author Share Posted April 4, 2020 Ok, done. Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 4, 2020 Author Share Posted April 4, 2020 That's an interesting mistake. I did this : VOID REFIT_MENU_SCREEN::AddMenuInfoLine(IN XStringW& InfoLine) { InfoLines.AddReference(&InfoLine, true); } which results to store a reference in a container (XObjArray). Problem is that Infoline will probably be destroyed at some point (only case it would not is if the caller supply a reference to a global object). Long story short : don't do what I did !!! Rule of thumb : never put a reference to a parameter in a container/collection. Link to comment Share on other sites More sharing options...
Slice Posted April 4, 2020 Share Posted April 4, 2020 I get this error /Users/sergey/src/CloverHackyColor/rEFIt_UEFI/refit/menu.cpp: In function 'void AboutRefit()': /Users/sergey/src/CloverHackyColor/rEFIt_UEFI/refit/menu.cpp:1385:29: error: zero-length gnu_printf format string [-Werror=format-zero-length] 1385 | AboutMenu.AddMenuInfo_f(""); | ^~ /Users/sergey/src/CloverHackyColor/rEFIt_UEFI/refit/menu.cpp:1398:29: error: zero-length gnu_printf format string [-Werror=format-zero-length] 1398 | AboutMenu.AddMenuInfo_f(""); | ^~ cc1plus: all warnings being treated as errors Link to comment Share on other sites More sharing options...
Jief_Machak Posted April 4, 2020 Author Share Posted April 4, 2020 Strange, I tried to compile with edkII. I guess, for empty line you need to do use AddMenuInfo_f(“%s”, “”) Link to comment Share on other sites More sharing options...
Slice Posted April 4, 2020 Share Posted April 4, 2020 Resolved by one space " ". Then I have conflicts menu.cpp and REFIT_MENU_SCREEN.cpp. Link to comment Share on other sites More sharing options...
Slice Posted April 5, 2020 Share Posted April 5, 2020 I cleaned up menu.cpp that apperas to be broken because I forgot to to do git pull before my changes. There is a risk anyway to merge two variants with messy codes. Now it looks like working. Delete your copy of menu.cpp before do git pull. XTHEME is almost working but one bug is still unresolved: theme switching is not working. Then we can exclude non-XTHEME codes. Link to comment Share on other sites More sharing options...
Recommended Posts