Saurabh Dhage
Saurabh Dhage

Reputation: 1711

How to change or add dark theme to CodeBlocks?

I have just installed Codeblocks in my Windows. When I launch the application the background of the screen where we write the code is white. I would prefer black or any other color. I am not sure whether we can change the color/theme OR add more themes.

Upvotes: 4

Views: 101092

Answers (4)

Unix
Unix

Reputation: 2644

First, you need to download some syntax color schemes, so I recommend you to download this file: colour_themes.conf. Then you will have to install it. Follow these steps:

  • Close the program Code::Blocks.
  • Run the program cb_sharing_config.exe (for Windows users, so it's your case). For Linux or Mac users, run the command cb_share_config from the terminal.
  • This program UI has 2 columns. In the left column, you have to load the downloaded file: colour_themes.conf. In the right column, you have to indicate the file default.conf (it will find the path automatically).
  • Select the themes you want to import to Code::Blocks. Then, click Transfer to transfer them to the file default.conf. Finally click Save. You probably want to select them all to use them later.

Now, the color schemes are installed, so it's time to select a new one:

  • Open the program Code::Blocks.
  • Go to the menu: Settings > Editor and select the tab Syntax highlighting.
  • You will see a select box with the label colour theme; select one.

Finally, if you have chosen a darker theme, you might have trouble seeing your text cursor or caret, with its colour being a separate setting:

  • Go to the menu: Settings > Editor and select the tab Margins and caret.
  • In the Caret section, change the Colour from the default black to a more contrasting colour for your theme, like white or yellow in case of a dark theme.

Upvotes: 12

万顷茫然
万顷茫然

Reputation: 139

Now There is a better answer to This Question.wxWidgets has supported dark mode since its v3.3 dev version. You can try visiting C::B Dark mode on Windows to find the surprising result! CodeBlocks Dark!

Upvotes: 2

Samuel Francis
Samuel Francis

Reputation: 71

Go to this site https://gist.github.com/yzhong52/6852140faa233408de67.
Download the file as zip, extract and copy out the colour_themes.config file.
Close CodeBlocks.
Open CodeBlocks Share Config on the machine.
Click Source configuration file ... and select the downloaded colour_themes.config file.
Click Destination configuration file ... > Local Disk > Users > Your PC Name > AppData > Roaming > CodeBlocks > Choose default.conf.
Meanwhile set your file explorer to show hidden items so as to show AppData folder.
Mark/check all the boxes showing under the Source configuration file.
Then click Transfer >>.
Click Save.
Open CodeBlock, go to Settings > Editor... > Syntax highlighting.
Select default > click OK.
Now open your code.
You will notice you can't see your cursor, let's fix that.
Settings > Editor... > Margins and caret.
Click Colour, change it to white, click OK.

Enjoy :)

Upvotes: 7

talentless
talentless

Reputation: 175

Follow this tutorial. It will only change the code editor area though, not the menus and toolbars.

Upvotes: 2

Related Questions