Author

Topic: How to modify the look bitcoin GUI Client. (Read 355 times)

member
Activity: 450
Merit: 10
Just by mentioning "QMenuBar " in the styleSheet function is enough for the code to know it will be the modifications going to the menubar directly?

Yes.

Hi okk, sadly it didn't work, I keep looking for a solution, i'll share here  everything i'll find Smiley
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Just by mentioning "QMenuBar " in the styleSheet function is enough for the code to know it will be the modifications going to the menubar directly?

Yes.
member
Activity: 450
Merit: 10
~

Hi, thank you!

What i meant also is, what file exactly? Like you said " you place a line in the same file "  But, which file?
That's the thing, there is no .ui file for the menu bar.

It is only mentioned in the bitcoingui.cpp, it explains in which order are placed the functions:

You're actually not supposed to put it in the C++ file. You're supposed to place it in here https://github.com/bitcoin/bitcoin/blob/master/src/qt/forms/overviewpage.ui

Where is has these lines at the very beginning:

Code:


 OverviewPage
  <-- insert code block below this line
 
   
    0
    0
...

Code:
insert below lines --v
   
      QMenuBar { background-color: color:#FFFFFF; }
      QWindow { background-color: color:#FFFFFF; }
     



The way UI files are composed, is that they represent whole windows and dialog boxes (the kind that your window manager can minimize and maximize) So this includes the body of a window, the status bar, all the buttons and radios and input boxes inside the entire window, and so on. This means all these parts can be styled just for that window in the respective UI file.

The c++ files are just for connecting functions that run on button presses and displaying text.

Hi! And thanks again for your reply


AAAaaah ok i see! Just by mentioning "QMenuBar " in the styleSheet function is enough for the code to know it will be the modifications going to the menubar directly?

This is awesome lol, ok i'll test it right away thanks man!
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
~

Hi, thank you!

What i meant also is, what file exactly? Like you said " you place a line in the same file "  But, which file?
That's the thing, there is no .ui file for the menu bar.

It is only mentioned in the bitcoingui.cpp, it explains in which order are placed the functions:

You're actually not supposed to put it in the C++ file. You're supposed to place it in here https://github.com/bitcoin/bitcoin/blob/master/src/qt/forms/overviewpage.ui

Where is has these lines at the very beginning:

Code:


 OverviewPage
  <-- insert code block below this line
 
   
    0
    0
...

Code:
insert below lines --v
   
      QMenuBar { background-color: color:#FFFFFF; }
      QWindow { background-color: color:#FFFFFF; }
     



The way UI files are composed, is that they represent whole windows and dialog boxes (the kind that your window manager can minimize and maximize) So this includes the body of a window, the status bar, all the buttons and radios and input boxes inside the entire window, and so on. This means all these parts can be styled just for that window in the respective UI file.

The c++ files are just for connecting functions that run on button presses and displaying text.
member
Activity: 450
Merit: 10

QMenuBar is the Qt widget that draws the long menu strips at the top of the screen (see above image).

You place a line like this in the same file, right between the tag like this:

Hi, thank you!

What i meant also is, what file exactly? Like you said " you place a line in the same file "  But, which file?
That's the thing, there is no .ui file for the menu bar.

It is only mentioned in the bitcoingui.cpp, it explains in which order are placed the functions:

Code:
   // Configure the menus
    QMenu *file = appMenuBar->addMenu(tr("&File"));
    if(walletFrame)
    {
        file->addAction(openAction);
        file->addAction(backupWalletAction);
        file->addAction(signMessageAction);
        file->addAction(verifyMessageAction);
        file->addSeparator();
        file->addAction(usedSendingAddressesAction);
        file->addAction(usedReceivingAddressesAction);
        file->addSeparator();
    }

But the bitcoingui.cpp cannot contains any functions which works only with XML code like in the .ui files   Embarrassed  Embarrassed
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
What is QMenuBar?  Is this a part of Qt Creator or something? And which file would it be to be modified, in the bitcoin source code for example?

QMenuBar is the Qt widget that draws the long menu strips at the top of the screen (see above image).

You place a line like this in the same file, right between the tag like this:

Code:
   
      QMenuBar { background-color: color:#FFFFFF; }
      QWindow { background-color: color:#FFFFFF; }
    

QMenuBar class documentation for anyone interested in reading
member
Activity: 450
Merit: 10

Then you can skin that by replacing the style sheet with QMenuBar ... instead of QWindow.

Hi

Oh okkk, i didn't quite understand sorry.

What is QMenuBar?  Is this a part of Qt Creator or something? And which file would it be to be modified, in the bitcoin source code for example?

Thanks
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Hey, thank ive found out already, i use Qt Creator it 's much easier!

Unfortunately the .ui files from /qt/forms folder don't include the possibility of modifying the header menus.

I keep looking for!

Thank you for responding btw

If you are talking about the menu bar widget that looks like this:



Then you can skin that by replacing the style sheet with QMenuBar ... instead of QWindow.
member
Activity: 450
Merit: 10
Hi, have you find out for changing the whole background? I'd like to make a white background instead of basic system default one (grey ugly for Windows)

For the main window (and this only changes the main window) you open the overviewpage.ui file in the src/qt/forms folder in a text editor and right below the line line at the top, add the following lines:

Code:
     
      QWindow { background-color: color:#FFFFFF; }
     

The color is in hex notation so in this case the background will be white.

Repeat this process for all the other dialogs whose background you want to change by editing their respective files in that folder.


Hey, thank ive found out already, i use Qt Creator it 's much easier!

Unfortunately the .ui files from /qt/forms folder don't include the possibility of modifying the header menus.

I keep looking for!

Thank you for responding btw
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Hi, have you find out for changing the whole background? I'd like to make a white background instead of basic system default one (grey ugly for Windows)

For the main window (and this only changes the main window) you open the overviewpage.ui file in the src/qt/forms folder in a text editor and right below the line line at the top, add the following lines:

Code:
     
      QWindow { background-color: color:#FFFFFF; }
     

The color is in hex notation so in this case the background will be white.

Repeat this process for all the other dialogs whose background you want to change by editing their respective files in that folder.
member
Activity: 450
Merit: 10
I was playing in the file:
Code:
bitcoingui.cpp

but I still can't find where I could change the whole background of the GUI.


any ideas guys?

Hi, have you find out for changing the whole background? I'd like to make a white background instead of basic system default one (grey ugly for Windows)
HCP
legendary
Activity: 2086
Merit: 4363
As per the README here: https://github.com/bitcoin/bitcoin/tree/master/src/qt
forms

Contains Designer UI files. They are created with [Qt Creator](#use-qt-Creator-as IDE), but can be edited using any text editor.

The UI stuff for the forms is in the "forms" folder here: https://github.com/bitcoin/bitcoin/tree/master/src/qt/forms

Follow the "Designer UI" link for more info (http://doc.qt.io/qt-5.9/designer-using-a-ui-file.html)
newbie
Activity: 9
Merit: 0
I was playing in the file:
Code:
bitcoingui.cpp

but I still can't find where I could change the whole background of the GUI.


any ideas guys?
Jump to:
© 2020, Bitcointalksearch.org