Skip to content

Commit

Permalink
Merge branch '45-increase-default-margins' into 'main'
Browse files Browse the repository at this point in the history
Introducing reader view

Closes #45

See merge request libreweb/browser!29
  • Loading branch information
melroy89 committed Feb 28, 2022
2 parents a83f92f + a59140d commit ed1e8db
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 70 deletions.
13 changes: 10 additions & 3 deletions src/draw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Draw::Draw(MiddlewareInterface& middleware)
{
this->disableEdit();
set_top_margin(12);
set_left_margin(20); // fallback
set_right_margin(20); // fallback
set_left_margin(10); // fallback
set_right_margin(10); // fallback
set_bottom_margin(0);
set_indent(0); // fallback
set_monospace(false);
Expand Down Expand Up @@ -343,6 +343,14 @@ void Draw::newDocument()
this->redoPool.clear();
this->clear();

// Set margins to defaults in editor mode
set_left_margin(10);
set_right_margin(10);
// Set indent to zero
set_indent(0);
// Reset word wrapping to default
set_wrap_mode(Gtk::WRAP_WORD_CHAR);

enableEdit();
grab_focus(); // Claim focus on text view
}
Expand Down Expand Up @@ -738,7 +746,6 @@ void Draw::insert_image()
buffer->end_user_action();
}

// TODO: set_monospace(true)
void Draw::make_code()
{
Gtk::TextBuffer::iterator start, end;
Expand Down
Loading

0 comments on commit ed1e8db

Please sign in to comment.