Unverified Commit f5d7f518 authored by Manuel Genovés's avatar Manuel Genovés Committed by GitHub
Browse files

Merge pull request #143 from goncalossilva/various_improvements

This PR includes various fixes and improvements, most of which I discussed with @somas95 a couple of weeks ago. It also includes some refactoring, mainly to improve encapsulation.

Fixes #17  
Fixes #75 
Fixes #90 
Fixes #120
Fixes #122

Some considerations/questions follow.

**Commit messages**
I recommend reviewing each commit message carefully, as they explain the thinking behind each change. Not everything is small or linear, and hopefully the commit message explains the background and reasoning properly. If anything is missing, I'm happy to try to explain.

**Translations**
There are a few capitalization/copy fixes. I am unsure how this affects translations, or if there's any work I can to make the transition easier. For instance, how are the po files updated?

**Styling**
Styling is subjective, and although I claim to address #90, it's important to note that I'm a fan of UberWriter's simplistic style, reminiscent of iA Writer's approach. As such, I didn't introduce any sizing nor color changes, as I don't personally agree with this direction. Instead, the changes are subtle:
* For links, the link/syntax part is greyed out, without any further changes
* For code blocks, they are indented similarly to quotations, without any further changes

**UI changes**
There are (very minor) UI changes within the places that were touched, mainly preferences and the export dialog. Most of these are around improving small things, such as spacing (eg. multiples of 8), slightly broken alignments, etc.

The only exception would be the removal of ODT as one of the export options in the top bar. As before, subjective, but I find that a sub-window's top bar with 6 horizontal buttons is a little overwhelming, and considering that ODT is still available within the advanced tab, I propose that we remove it as a default option and have a more balanced top bar. I am assuming that PDF/HTML are the most used, but please let me know if that's not the case.

**Further work**
I have a few more tasks planned for the upcoming weeks, hopefully built on top of this codebase as it makes some of them much easier. [Here's a screenshot of my Todoist.](https://cl.ly/4160755d210d/gnome-shell-screenshot-3MMO0Z.png) Hopefully this helps knowing what to expect. 😊 
parents cada4f67 432ef9d5
......@@ -4,35 +4,47 @@
<schema path="/de/wolfvollprecht/UberWriter/" id="de.wolfvollprecht.UberWriter">
<key name='dark-mode-auto' type='b'>
<default>true</default>
<summary>Set dark mode automatically</summary>
<description>
Whether dark mode depends on the system theme, or is set to what the user specifies.
</description>
</key>
<key name='dark-mode' type='b'>
<default>false</default>
<summary>Dark mode</summary>
<summary>Force dark mode</summary>
<description>
If enabled, the window will be dark themed
If disabled, the window will be light themed
asked to install them manually.
Enable or disable the dark mode.
</description>
</key>
<key name='spellcheck' type='b'>
<default>true</default>
<summary>Spellcheck</summary>
<summary>Check spelling while typing</summary>
<description>
Enable/disable spellchecking in the application.
Enable or disable spellchecking.
</description>
</key>
<key name='gradient-overlay' type='b'>
<default>false</default>
<summary>Show gradient overlay</summary>
<summary>Draw scroll gradient</summary>
<description>
Show a gradient overlay over the text at the top anf bottom of the window.
It can cause performance problems to some users
It can cause performance problems to some users.
</description>
</key>
<key name='input-format' type='s'>
<default>"markdown"</default>
<summary>Input format</summary>
<description>
Input format to use when previewing and exporting using Pandoc.
</description>
</key>
<key name='poll-motion' type='b'>
<default>true</default>
<summary>Allow Uberwriter to poll cursor motion</summary>
<description>
Used for hidding the headerbar after 3 seconds if the cursor is not moving.
Hide the header and status bars if the cursor is not moving.
</description>
</key>
<key name='open-file-path' type='s'>
......
......@@ -8,42 +8,39 @@
bind "<ctl>i" { "insert-italic" () };
bind "<ctl>b" { "insert-bold" () };
bind "<ctl>r" { "insert-hrule" () };
bind "<ctl>u" { "insert-ulistitem" () };
bind "<ctl>h" { "insert-heading" () };
bind "<ctl>u" { "insert-listitem" () };
bind "<ctl>h" { "insert-header" () };
bind "<ctl>z" { "undo" () };
bind "<ctl>y" { "redo" () };
bind "<ctl><shift>d" { "insert-strikeout" () };
bind "<ctl><shift>d" { "insert-strikethrough" () };
/*bind "<ctl>t" { "insert-at-cursor" ('[ ] ') };*/
bind "<ctl><shift>z" { "redo" () };
}
/* Main window and text colors */
.uberwriter_window {
.uberwriter-window {
/*border-radius: 7px 7px 3px 3px;*/
background: @background_color;
caret-color: @foreground_color;
}
.uberwriter_window.small .uberwriter-editor {
.uberwriter-window .uberwriter-editor {
font-family: 'Fira Mono', monospace;
font-size: 12px;
}
.uberwriter_window grid {
background-color: @background_color;
font-size: 16px;
padding-top: 80px;
padding-bottom: 16px;
}
#UberwriterWindow.medium .uberwriter-editor {
font-family: 'Fira Mono', monospace;
font-size: 15px;
.uberwriter-window.small .uberwriter-editor {
font-size: 14px;
}
#UberwriterWindow.large .uberwriter-editor {
font-family: 'Fira Mono', monospace;
.uberwriter-window.large .uberwriter-editor {
font-size: 18px;
}
#titlebar_revealer {
#titlebar-revealer {
padding: 0;
}
......@@ -52,8 +49,8 @@
background: transparent;
}
#titlebar_container {
background: @background_color;
#titlebar-container {
background: @background_color;
}
.uberwriter-editor {
......@@ -89,11 +86,11 @@
}
.status_bar_box label {
.status-bar-box label {
color: #666;
}
.status_bar_box button {
.status-bar-box button {
/* finding reset */
background-color: @background_color;
text-shadow: inherit;
......@@ -118,26 +115,26 @@
transition: 100ms ease-in;
}
.status_bar_box button:hover,
.status_bar_box button:checked {
.status-bar-box button:hover,
.status-bar-box button:checked {
transition: 0s ease-in;
color: @background_color;
background-color: #666;
}
.status_bar_box button:hover label,
.status_bar_box button:checked label {
.status-bar-box button:hover label,
.status-bar-box button:checked label {
color: @background_color;
}
.status_bar_box button:active {
.status-bar-box button:active {
color: #EEE;
background-color: #EEE;
background-image: none;
box-shadow: 0 0 2px rgba(0,0,0,0.4)
}
.status_bar_box separator {
.status-bar-box separator {
border-color: #999;
border-right: none;
}
......@@ -150,7 +147,7 @@
background: #FFF;
}
#UberwriterWindow treeview {
.uberwriter-window treeview {
padding: 3px 3px 3px 3px;
}
......@@ -165,7 +162,7 @@
padding: 5px;
}
/* .QuickPreviewPopup {
/* .quick-preview-popup {
padding: 5px;
margin: 5px;
border: 1px solid #333;
......@@ -183,8 +180,7 @@
border: 5px solid @background_color;
}
#LexikonBubble .lexikon_heading {
/*font: serif 12;*/
#LexikonBubble .lexikon-heading {
font-family: serif;
font-size: 12px;
padding-bottom: 5px;
......@@ -193,21 +189,21 @@
padding-left: 10px;
}
#LexikonBubble .lexikon_num {
#LexikonBubble .lexikon-num {
padding-right: 5px;
padding-left: 20px;
}
.QuickPreviewPopup {
.quick-preview-popup {
background-color: @background_color;
}
.QuickPreviewPopup grid {
.quick-preview-popup grid {
background-color: @background_color;
color: @foreground_color;
border-color: @background_color;
}
.QuickPreviewPopup label {
.quick-preview-popup label {
color: @foreground_color;
}
\ No newline at end of file
......@@ -6,7 +6,12 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="margin_left">2</property>
<property name="margin_right">2</property>
<property name="margin_top">2</property>
<property name="margin_bottom">2</property>
<property name="hexpand">True</property>
<property name="row_spacing">2</property>
<child>
<object class="GtkGrid" id="advanced_export_grid">
<property name="visible">True</property>
......@@ -19,6 +24,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="margin_right">8</property>
<property name="label_xalign">0</property>
<property name="shadow_type">out</property>
<child>
......@@ -30,8 +36,9 @@
<object class="GtkBox" id="box6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="margin_right">8</property>
<property name="margin_top">4</property>
<property name="margin_bottom">4</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="smart">
......@@ -42,7 +49,6 @@
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Pandoc can automatically make "--" to a long dash and more</property>
<property name="halign">start</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
......@@ -120,7 +126,7 @@
</child>
<child>
<object class="GtkCheckButton" id="incremental">
<property name="label" translatable="yes">Slideshow incremental bullets</property>
<property name="label" translatable="yes">Slideshow Incremental Bullets</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -158,6 +164,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="margin_right">8</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame" id="frame1">
......@@ -174,18 +181,16 @@
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="margin_top">4</property>
<property name="margin_bottom">4</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="highlight">
<property name="label" translatable="yes">Highlight syntax</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Highlight Syntax</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">start</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
......@@ -198,11 +203,13 @@
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">4</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Choose a color theme for syntax highlighting</property>
<property name="margin_left">4</property>
<property name="label" translatable="yes">Highlight style </property>
</object>
<packing>
......@@ -216,6 +223,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Choose a color theme for syntax highlighting</property>
<property name="margin_left">8</property>
<property name="margin_right">8</property>
<property name="active">0</property>
<property name="active_id">0</property>
<items>
......@@ -250,7 +259,7 @@
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Syntax highlighting&lt;/b&gt; (HTML, LaTeX)</property>
<property name="label" translatable="yes">&lt;b&gt;Syntax Highlighting&lt;/b&gt; (HTML, LaTeX)</property>
<property name="use_markup">True</property>
</object>
</child>
......@@ -271,13 +280,40 @@
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">4</property>
<property name="margin_bottom">4</property>
<property name="left_padding">12</property>
<child>
<object class="GtkFileChooserButton" id="bib_filechooser">
<object class="GtkBox" id="box7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Choose a bibliography file</property>
<property name="label" translatable="yes">File</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="bib_filechooser">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Choose a bibliography file</property>
<property name="margin_left">8</property>
<property name="margin_right">8</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
......@@ -286,7 +322,7 @@
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Bibliography File&lt;/b&gt;</property>
<property name="label" translatable="yes">&lt;b&gt;Bibliography &lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
......@@ -320,13 +356,13 @@
<object class="GtkBox" id="box4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="margin_top">4</property>
<property name="margin_bottom">4</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkCheckButton" id="self_contained">
<property name="label" translatable="yes">Self Contained</property>
<property name="label" translatable="yes">Self-contained</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
......@@ -343,13 +379,14 @@
</child>
<child>
<object class="GtkCheckButton" id="html5">
<property name="label" translatable="yes">HTML 5</property>
<property name="label" translatable="yes">HTML5</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Use HTML 5 syntax</property>
<property name="tooltip_text" translatable="yes">Use HTML5 syntax</property>
<property name="halign">start</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
......@@ -367,6 +404,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Choose a CSS File that you want to use</property>
<property name="margin_left">4</property>
<property name="label" translatable="yes">CSS File</property>
</object>
<packing>
......@@ -380,6 +418,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Choose a CSS File that you want to use</property>
<property name="margin_left">8</property>
<property name="margin_right">8</property>
</object>
<packing>
<property name="expand">True</property>
......@@ -426,7 +466,7 @@
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="relief">none</property>
<property name="uri">http://johnmacfarlane.net/pandoc/README.html</property>
<property name="uri">https://pandoc.org/MANUAL.html</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -547,6 +587,19 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition_type">crossfade</property>
<child>
<object class="GtkFileChooserWidget" id="html">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action">save</property>
<property name="filter">html_filter</property>
</object>
<packing>
<property name="name">html</property>
<property name="title" translatable="yes">HTML</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFileChooserWidget" id="pdf">
<property name="visible">True</property>
......@@ -570,32 +623,6 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFileChooserWidget" id="html">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action">save</property>
<property name="filter">html_filter</property>
</object>
<packing>
<property name="name">html</property>
<property name="title" translatable="yes">HTML</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFileChooserWidget" id="odt">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action">save</property>
<property name="filter">odt_filter</property>
</object>
<packing>
<property name="name">odt</property>
<property name="title" translatable="yes">ODT</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkFileChooserWidget" id="advanced">
<property name="visible">True</property>
......
......@@ -30,17 +30,7 @@
</item>
<item>
<attribute name="label" translatable="yes">Copy HTML</attribute>
<attribute name="action">app.HTML_copy</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Open Tutorial</attribute>
<attribute name="action">app.open_examples</attribute>
</item>
<item>
<attribute name="action">app.help</attribute>
<attribute name="label" translatable="yes">Pandoc _Help</attribute>
<attribute name="action">app.copy_html</attribute>
</item>
</section>
<section>
......@@ -52,6 +42,10 @@
<attribute name="action">app.shortcuts</attribute>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Open Tutorial</attribute>
<attribute name="action">app.open_tutorial</attribute>
</item>
<item>
<attribute name="action">app.about</attribute>
<attribute name="label" translatable="yes">_About UberWriter</attribute>
......
......@@ -2,6 +2,11 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkImage" id="help">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">dialog-information-symbolic</property>
</object>
<object class="GtkWindow" id="PreferencesWindow">
<property name="can_focus">False</property>
<property name="modal">True</property>
......@@ -30,19 +35,18 @@
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="margin_left">30</property>
<property name="margin_right">30</property>
<property name="margin_top">30</property>
<property name="margin_bottom">30</property>
<property name="row_spacing">10</property>
<property name="column_spacing">10</property>
<property name="margin_left">16</property>
<property name="margin_right">16</property>
<property name="margin_top">16</property>
<property name="margin_bottom">16</property>
<property name="row_spacing">8</property>
<property name="column_spacing">8</property>
<child>
<object class="GtkLabel" id="Dark_mode_label">
<object class="GtkLabel" id="dark_mode_auto_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="label" translatable="yes">Use dark mode</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Set dark mode automatically</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -51,11 +55,22 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="Spellcheck_label">
<object class="GtkSwitch" id="dark_mode_auto_switch">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Autospellcheck</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="dark_mode_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Force dark mode</property>
<property name="justify">right</property>
</object>
<packing>
......@@ -64,66 +79,121 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="Gradient_label">
<object class="GtkSwitch" id="dark_mode_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="spellcheck_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Check spelling while typing</property>
<property name="justify">right</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="spellcheck_switch">