Page 1 of 1

Change Theme in Code::Blocks Rate Topic: -----

#1 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3640
  • View blog
  • Posts: 12,614
  • Joined: 12-December 12

Posted 28 July 2014 - 03:41 PM

I changed my theme in Code::Blocks to Son of Obsidian. There were a few steps involved so thought I would provide a guide here.

(This theme only targets C/C++, other themes may target more than these languages.)

I'm on Windows, for slightly different Linux steps see here.

My chosen theme:

Attached Image




Download your chosen theme, there are a number here. (I actually just viewed the raw source and used File/Save in the browser.)

If the file downloads as 'yourtheme.conf.txt' then remove the '.txt' extension.

MAKE SURE CODE::BLOCKS IS NOT RUNNING

Go into the CodeBlocks folder; mine was at C:\Program Files (x86)\CodeBlocks. Run the application cb_share_config.

Attached Image

If the 'Destination configuration file' doesn't appear on the right then click the ellipsis (..) and it will take you to the correct folder. Mine was C:\Users\Andrew\AppData\Roaming\CodeBlocks.

Copy this location and then go into it from Windows Explorer. Copy and paste the file default.conf - I wanted to keep a copy of it in-case things go pear-shaped.

Return to the cb_share_config app, or re-start it if you exited it.

Press the ellipsis (...) next to 'Source configuration file' and find your new theme file.

Tick the three boxes on the left that you see in my screenshot - you may not have three.

I'm not sure of the difference between these so ticked them all. Read all comments below in-case someone elaborates on what each of these do, and whether you need, or want, them all.

Press the Transfer button, and acknowledge any messages. You will then also have to press the Save button (center-bottom of the dialog).

Okay, you can now exit this application and start Code::Blocks. You may have to go to the Settings menu, Editor, click the Syntax Highlighting button in the left-panel and select your theme from the 'Colour theme' drop-down at the top.

There was one more thing I had to do with my chosen theme, which was to change the default caret colour, as it was invisible!

In the same Settings, above the Syntax Highlighting button on the left is one for Margins and caret - choose a sensible caret-colour, and/or size, from here.

This post has been edited by andrewsw: 29 July 2014 - 08:47 AM


Is This A Good Question/Topic? 1
  • +

Replies To: Change Theme in Code::Blocks

#2 ludiklovn  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 17-May 14

Posted 29 July 2014 - 08:30 AM

Works very nice, but it seems it is necessary to assign desired theme to every language that you want to use it for, otherwise it will use default theme.
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3640
  • View blog
  • Posts: 12,614
  • Joined: 12-December 12

Posted 29 July 2014 - 08:44 AM

Hello, and thank you.

In son_of_obsidian.conf it has this
<ACTIVE_LANG>
<str>
    <![CDATA[C/C++]]>
</str>
</ACTIVE_LANG>

I'm only using C/C++ so hadn't noticed that it only targets these languages.

Perhaps some of the other themes target multiple-languages?

I'll take a wild guess and suggest that we could modify to:
<ACTIVE_LANG>
<str>
    <![CDATA[C/C++]]>
</str>
<str>
    <![CDATA[Pascal]]>
</str>
</ACTIVE_LANG>

If you find out anything about this yourself please let us know ;)

Or maybe..
<ACTIVE_LANG>
<str>
    <![CDATA[C/C++/Pascal/Caml]]>
</str>
</ACTIVE_LANG>

..but this is just guesswork at the moment.

This post has been edited by andrewsw: 29 July 2014 - 08:53 AM

Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3640
  • View blog
  • Posts: 12,614
  • Joined: 12-December 12

Posted 29 July 2014 - 08:51 AM

Yes, it says in the list of themes-link that I provided:

Quote

There are dark themes and light themes. Custom colours are configured on each theme on a per-language basis. The themes below have been configured for C/C++ only; other languages are unchanged from the default colour theme.

At this point I don't know if there is a single theme that will target (or can be made to target) multiple languages.

My excuse is, of course, that this is the "C++ Tutorials" section ;)

This post has been edited by andrewsw: 29 July 2014 - 08:55 AM

Was This Post Helpful? 0
  • +
  • -

#5 ludiklovn  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 17-May 14

Posted 29 July 2014 - 12:03 PM

I am in a bit of a rush, so i didn't read all instructions, honestly, just installed themes, made a new file, didn't work, made a new C file, that did work. Thank you for clarification.
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3640
  • View blog
  • Posts: 12,614
  • Joined: 12-December 12

Posted 29 July 2014 - 02:08 PM

If any reader wants to have a go at this then I believe you could:

  • Copy the file and rename to 'special_theme.conf';
  • Open the file and change 'C/C++' to 'Pascal' (or another language) throughout (note that there is also a mention of 'C/C++' towards the bottom of the 'son_of_oblivion' file);
  • Also change any mention of 'son_of_oblivion' to 'special_theme' in this file.

Then follow the instructions in the tutorial.

It does seem though, that you would have to switch themes when switching languages :dozingoff:. I still don't know if it is possible to use a single theme-file across a number of languages. Maybe someone else will advise ;)
Was This Post Helpful? 1
  • +
  • -

#7 Deepak_Patil  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 01-July 14

Posted 16 August 2014 - 10:24 AM

thanks adrew for guidelines. they worked for me but i think some alterations and clarifications are required in them.

your guideline,
Download your chosen theme, there are a number here. (I actually just viewed the raw source and used File/Save in the browser.)If the file downloads as 'yourtheme.conf.txt' then remove the '.txt' extension.


my suggestion/comment,
here the code should be copied in notepad and given extension .config
file/save in the browser is not clear - please explain


your guideline,
Tick the three boxes on the left that you see in my screenshot - you may not have three.
I'm not sure of the difference between these so ticked them all. Read all comments below in-case someone elaborates on what each of these do, and whether you need, or want, them all.


my suggestion/comment,
here we get colour_themes.config file in which all themes are availabe for codeblocks including son of obsision.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1