|
|
|
|
@ -444,12 +444,17 @@ void Tooltip::create_tags() {
|
|
|
|
|
code_tag = buffer->create_tag(); |
|
|
|
|
code_tag->property_family() = source_font_family; |
|
|
|
|
auto background_rgba = Gdk::RGBA(); |
|
|
|
|
auto line_rgba = Gdk::RGBA(); |
|
|
|
|
auto normal_color = window->get_style_context()->get_color(Gtk::StateFlags::STATE_FLAG_NORMAL); |
|
|
|
|
auto light_theme = (normal_color.get_red() + normal_color.get_green() + normal_color.get_blue()) / 3 < 0.5; |
|
|
|
|
if(light_theme) |
|
|
|
|
if(light_theme) { |
|
|
|
|
background_rgba.set_rgba(1.0, 1.0, 1.0, 0.4); |
|
|
|
|
else |
|
|
|
|
line_rgba.set_rgba(0.0, 0.0, 0.0, 0.25); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
background_rgba.set_rgba(0.0, 0.0, 0.0, 0.2); |
|
|
|
|
line_rgba.set_rgba(1.0, 1.0, 1.0, 0.25); |
|
|
|
|
} |
|
|
|
|
code_tag->property_background_rgba() = background_rgba; |
|
|
|
|
|
|
|
|
|
code_block_tag = buffer->create_tag(); |
|
|
|
|
@ -464,6 +469,11 @@ void Tooltip::create_tags() {
|
|
|
|
|
|
|
|
|
|
strikethrough_tag = buffer->create_tag(); |
|
|
|
|
strikethrough_tag->property_strikethrough() = true; |
|
|
|
|
|
|
|
|
|
line_tag = buffer->create_tag(); |
|
|
|
|
line_tag->property_paragraph_background_rgba() = line_rgba; |
|
|
|
|
line_tag->property_foreground_rgba() = line_rgba; |
|
|
|
|
line_tag->property_size() = 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -846,7 +856,7 @@ void Tooltip::insert_markdown(const std::string &input) {
|
|
|
|
|
if(i == input.size() || input[i] == '\n') { |
|
|
|
|
if(i < input.size()) |
|
|
|
|
++i; |
|
|
|
|
buffer->insert_at_cursor("---\n"); |
|
|
|
|
buffer->insert_with_tag(buffer->get_insert()->get_iter(), "---\n", line_tag); |
|
|
|
|
if(is_empty_line()) |
|
|
|
|
buffer->insert_at_cursor("\n"); |
|
|
|
|
return true; |
|
|
|
|
|