Browse Source

Added word_wrap option for terminal

merge-requests/428/merge
eidheim 4 months ago
parent
commit
729e1660b7
  1. 2
      CMakeLists.txt
  2. 4
      src/config.cpp
  3. 1
      src/config.hpp
  4. 2
      src/terminal.cpp

2
CMakeLists.txt

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10)
project(juci)
set(JUCI_VERSION "1.8.1")
set(JUCI_VERSION "1.8.1.1")
set(CPACK_PACKAGE_NAME "jucipp")
set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim <eidheim@gmail.com>")

4
src/config.cpp

@ -205,6 +205,7 @@ void Config::read(const JSON &cfg) {
terminal.clear_on_compile = terminal_json.boolean("clear_on_compile", JSON::ParseOptions::accept_string);
terminal.clear_on_run_command = terminal_json.boolean("clear_on_run_command", JSON::ParseOptions::accept_string);
terminal.hide_entry_on_run_command = terminal_json.boolean("hide_entry_on_run_command", JSON::ParseOptions::accept_string);
terminal.word_wrap = terminal_json.boolean("word_wrap", JSON::ParseOptions::accept_string);
auto log_json = cfg.object("log");
log.libclang = log_json.boolean("libclang", JSON::ParseOptions::accept_string);
@ -319,7 +320,8 @@ std::string Config::default_config() {
"font": "",
"clear_on_compile": true,
"clear_on_run_command": false,
"hide_entry_on_run_command": true
"hide_entry_on_run_command": true,
"word_wrap": false
},
"project": {
"default_build_path_comment": "Use <project_directory_name> to insert the project top level directory name",

1
src/config.hpp

@ -28,6 +28,7 @@ public:
bool clear_on_compile;
bool clear_on_run_command;
bool hide_entry_on_run_command;
bool word_wrap;
};
class Project {

2
src/terminal.cpp

@ -590,6 +590,8 @@ void Terminal::async_print(std::string message, bool bold) {
}
void Terminal::configure() {
set_wrap_mode(Config::get().terminal.word_wrap ? Gtk::WrapMode::WRAP_WORD_CHAR : Gtk::WrapMode::WRAP_NONE);
link_tag->property_foreground_rgba() = get_style_context()->get_color(Gtk::StateFlags::STATE_FLAG_LINK);
auto normal_color = get_style_context()->get_color(Gtk::StateFlags::STATE_FLAG_NORMAL);

Loading…
Cancel
Save