Jump to content

C++ proposition


Jief_Machak
 Share

823 posts in this topic

Recommended Posts

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

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

I am near at final cut with XTHEME refactoring.

Снимок экрана 2020-04-04 в 6.43.43.png

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

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

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

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

 Share

×
×
  • Create New...