Changeset 89522f27a66031ffc1904084a1ab36ceb0d09bb2
- Timestamp:
- 11/01/09 21:02:25 (4 years ago)
- Author:
- Armin Burgmeier <armin@…>
- git-author:
- Benjamin Herr <ben@0x539.de> / 2009-11-01T20:04:40Z+0100
- Parents:
- 9b62f6365de4d1740ae510df93023079d3ff3cd2
- Children:
- e78b79d23d374130c9b81ead5d63732d830f1614
- git-committer:
- Armin Burgmeier <armin@arbur.net> / 2009-11-01T21:02:25Z+0100
- Message:
-
Added "draw spaces" option
2009-11-01 Benjamin Herr <ben@…>
- code/core/preferences.hpp:
- code/core/preferences.cpp: Added view.whitespace_display option.
- code/dialogs/preferences-dialog.hpp:
- code/dialogs/preferences-dialog.cpp: Added a corresponding widget to
the View pane in the preferences dialog.
- code/core/docwindow.hpp:
- code/core/docwindow.cpp: Honor the setting.
- configure.ac: Require gtksourceview-2.0 >= 2.4 since
gtk_source_view_set_draw_spaces() is available only since this
version.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r9b62f63
|
r89522f2
|
|
| | 1 | 2009-11-01 Benjamin Herr <ben@0x539.de> |
| | 2 | |
| | 3 | * code/core/preferences.hpp: |
| | 4 | * code/core/preferences.cpp: Added view.whitespace_display option. |
| | 5 | |
| | 6 | * code/dialogs/preferences-dialog.hpp: |
| | 7 | * code/dialogs/preferences-dialog.cpp: Added a corresponding widget to |
| | 8 | the View pane in the preferences dialog. |
| | 9 | |
| | 10 | * code/core/docwindow.hpp: |
| | 11 | * code/core/docwindow.cpp: Honor the setting. |
| | 12 | |
| | 13 | * configure.ac: Require gtksourceview-2.0 >= 2.4 since |
| | 14 | gtk_source_view_set_draw_spaces() is available only since this |
| | 15 | version. |
| | 16 | |
| 1 | 17 | 2009-10-31 Armin Burgmeier <armin@arbur.net> |
| 2 | 18 | |
-
|
re861d03
|
r89522f2
|
|
| 189 | 189 | sigc::mem_fun(*this, |
| 190 | 190 | &DocWindow::on_bracket_highlight_changed)); |
| 191 | | |
| | 191 | m_preferences.view.whitespace_display.signal_changed().connect( |
| | 192 | sigc::mem_fun(*this, |
| | 193 | &DocWindow::on_whitespace_display_changed)); |
| 192 | 194 | m_preferences.appearance.font.signal_changed().connect( |
| 193 | 195 | sigc::mem_fun(*this, &DocWindow::on_font_changed)); |
| … |
… |
|
| 215 | 217 | gtk_source_buffer_set_highlight_matching_brackets( |
| 216 | 218 | m_buffer, m_preferences.view.bracket_highlight); |
| | 219 | gtk_source_view_set_draw_spaces( |
| | 220 | m_view, m_preferences.view.whitespace_display); |
| 217 | 221 | const Pango::FontDescription& desc = m_preferences.appearance.font; |
| 218 | 222 | gtk_widget_modify_font( |
| … |
… |
|
| 500 | 504 | } |
| 501 | 505 | |
| | 506 | void Gobby::DocWindow::on_whitespace_display_changed() |
| | 507 | { |
| | 508 | gtk_source_view_set_draw_spaces( |
| | 509 | m_view, m_preferences.view.whitespace_display); |
| | 510 | } |
| | 511 | |
| 502 | 512 | void Gobby::DocWindow::on_font_changed() |
| 503 | 513 | { |
-
|
re861d03
|
r89522f2
|
|
| 107 | 107 | void on_margin_pos_changed(); |
| 108 | 108 | void on_bracket_highlight_changed(); |
| | 109 | void on_whitespace_display_changed(); |
| 109 | 110 | |
| 110 | 111 | void on_font_changed(); |
-
|
rd932cb3
|
r89522f2
|
|
| 20 | 20 | #include "core/preferences.hpp" |
| 21 | 21 | |
| | 22 | // TODO: Support direct enum config storage via context specialization for |
| | 23 | // enums. |
| 22 | 24 | Gobby::Preferences::User::User(Config::ParentEntry& entry): |
| 23 | 25 | name(entry.get_value<Glib::ustring>("name", Glib::get_user_name())), |
| … |
… |
|
| 65 | 67 | margin_pos(entry.get_value<unsigned int>("margin-position", 80) ), |
| 66 | 68 | bracket_highlight(entry.get_value<bool>( |
| 67 | | "highlight-matching-brackets", true)) |
| | 69 | "highlight-matching-brackets", true)), |
| | 70 | whitespace_display(static_cast<GtkSourceDrawSpacesFlags>( |
| | 71 | entry.get_value<int>("display-whitespace", 0))) |
| 68 | 72 | { |
| 69 | 73 | } |
| … |
… |
|
| 77 | 81 | entry.set_value("margin-position", margin_pos); |
| 78 | 82 | entry.set_value("highlight-matching-brackets", bracket_highlight); |
| | 83 | entry.set_value("display-whitespace", |
| | 84 | static_cast<int>(whitespace_display)); |
| 79 | 85 | } |
| 80 | 86 | |
-
|
r6b79c69
|
r89522f2
|
|
| 23 | 23 | |
| 24 | 24 | #include "features.hpp" |
| | 25 | |
| | 26 | #include <gtksourceview/gtksourceview.h> |
| 25 | 27 | |
| 26 | 28 | #include <gtkmm/toolbar.h> |
| … |
… |
|
| 131 | 133 | Option<unsigned int> margin_pos; |
| 132 | 134 | Option<bool> bracket_highlight; |
| | 135 | Option<GtkSourceDrawSpacesFlags> whitespace_display; |
| 133 | 136 | }; |
| 134 | 137 | |
-
|
rd9e7c10
|
r89522f2
|
|
| 402 | 402 | m_group_margin(_("Right Margin") ), |
| 403 | 403 | m_group_bracket(_("Bracket Matching") ), |
| | 404 | m_group_spaces(_("Whitespace Display") ), |
| 404 | 405 | m_btn_wrap_text(_("Enable text wrapping") ), |
| 405 | 406 | m_btn_wrap_words(_("Do not split words over two lines") ), |
| … |
… |
|
| 408 | 409 | m_btn_margin_display(_("Display right margin") ), |
| 409 | 410 | m_lbl_margin_pos(_("Right margin at column:") ), |
| 410 | | m_btn_bracket_highlight(_("Highlight matching bracket") ) |
| | 411 | m_btn_bracket_highlight(_("Highlight matching bracket") ), |
| | 412 | m_cmb_spaces_display(preferences.view.whitespace_display) |
| 411 | 413 | { |
| 412 | 414 | Gtk::WrapMode mode = preferences.view.wrap_mode; |
| … |
… |
|
| 453 | 455 | preferences.view.bracket_highlight); |
| 454 | 456 | |
| | 457 | m_cmb_spaces_display.add( |
| | 458 | _("Display no whitespace"), |
| | 459 | static_cast<GtkSourceDrawSpacesFlags>(0)); |
| | 460 | m_cmb_spaces_display.add( |
| | 461 | _("Display spaces"), |
| | 462 | static_cast<GtkSourceDrawSpacesFlags>( |
| | 463 | GTK_SOURCE_DRAW_SPACES_SPACE | |
| | 464 | GTK_SOURCE_DRAW_SPACES_NBSP)); |
| | 465 | m_cmb_spaces_display.add( |
| | 466 | _("Display tabs"), |
| | 467 | static_cast<GtkSourceDrawSpacesFlags>( |
| | 468 | GTK_SOURCE_DRAW_SPACES_TAB)); |
| | 469 | m_cmb_spaces_display.add( |
| | 470 | _("Display tabs and spaces"), |
| | 471 | static_cast<GtkSourceDrawSpacesFlags>( |
| | 472 | GTK_SOURCE_DRAW_SPACES_SPACE | |
| | 473 | GTK_SOURCE_DRAW_SPACES_NBSP | |
| | 474 | GTK_SOURCE_DRAW_SPACES_TAB)); |
| | 475 | m_cmb_spaces_display.show(); |
| | 476 | |
| 455 | 477 | m_box_margin_pos.set_spacing(6); |
| 456 | 478 | m_box_margin_pos.set_sensitive(margin_display); |
| … |
… |
|
| 475 | 497 | m_group_bracket.add(m_btn_bracket_highlight); |
| 476 | 498 | m_group_bracket.show(); |
| 477 | | |
| | 499 | |
| | 500 | m_group_spaces.add(m_cmb_spaces_display); |
| | 501 | m_group_spaces.show(); |
| | 502 | |
| 478 | 503 | add(m_group_wrap); |
| 479 | 504 | add(m_group_linenum); |
| … |
… |
|
| 481 | 506 | add(m_group_margin); |
| 482 | 507 | add(m_group_bracket); |
| | 508 | add(m_group_spaces); |
| 483 | 509 | } |
| 484 | 510 | |
-
|
rd9e7c10
|
r89522f2
|
|
| 187 | 187 | Group m_group_margin; |
| 188 | 188 | Group m_group_bracket; |
| | 189 | Group m_group_spaces; |
| 189 | 190 | |
| 190 | 191 | Gtk::CheckButton m_btn_wrap_text; |
| … |
… |
|
| 201 | 202 | |
| 202 | 203 | Gtk::CheckButton m_btn_bracket_highlight; |
| | 204 | PreferencesComboBox<GtkSourceDrawSpacesFlags> |
| | 205 | m_cmb_spaces_display; |
| 203 | 206 | }; |
| 204 | 207 | |
-
|
rd451ded
|
r89522f2
|
|
| 37 | 37 | AM_CONDITIONAL(WIN32, test x$win32 = xtrue) |
| 38 | 38 | |
| 39 | | required_libs="libxml++-2.6 glibmm-2.4 >= 2.16.0 giomm-2.4 >= 2.16.4 gtkmm-2.4 >= 2.12.0 glib-2.0 >= 2.18.0 gthread-2.0 gtksourceview-2.0" |
| | 39 | required_libs="libxml++-2.6 glibmm-2.4 >= 2.16.0 giomm-2.4 >= 2.16.4 gtkmm-2.4 >= 2.12.0 glib-2.0 >= 2.18.0 gthread-2.0 gtksourceview-2.0 >= 2.4" |
| 40 | 40 | |
| 41 | 41 | # Check if we are running on OS X, for special link handling. |