Skip to content

Commit c2b5116

Browse files
authored
Merge pull request #147 from UberWriter/various-improvements
Various improvements
2 parents cada4f6 + f2d00f2 commit c2b5116

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2227
-2722
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ build/
55
debian/uberwriter/DEBIAN
66
debian/uberwriter/opt
77
debian/uberwriter/usr
8-
bin/
98
flatpak/*
109
!flatpak/fonts-download
1110
!flatpak/pandoc-download

bin/uberwriter

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/python3
2+
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3+
### BEGIN LICENSE
4+
# Copyright (C) 2012, Wolf Vollprecht <w.vollprecht@gmail.com>
5+
# This program is free software: you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 3, as published
7+
# by the Free Software Foundation.
8+
#
9+
# This program is distributed in the hope that it will be useful, but
10+
# WITHOUT ANY WARRANTY; without even the implied warranties of
11+
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12+
# PURPOSE. See the GNU General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License along
15+
# with this program. If not, see <http://www.gnu.org/licenses/>.
16+
### END LICENSE
17+
18+
### DO NOT EDIT THIS FILE ###
19+
20+
import sys
21+
import os
22+
23+
import pkg_resources
24+
25+
import gettext
26+
import locale
27+
28+
# Add project root directory (enable symlink and trunk execution)
29+
PROJECT_ROOT_DIRECTORY = os.path.abspath(
30+
os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0]))))
31+
32+
# Set the path if needed. This allows uberwriter to run without installing it :)
33+
python_path = []
34+
if os.path.abspath(__file__).startswith('/opt'):
35+
gettext.bindtextdomain('uberwriter', '/opt/extras.ubuntu.com/uberwriter/share/locale')
36+
syspath = sys.path[:] # copy to avoid infinite loop in pending objects
37+
for path in syspath:
38+
opt_path = path.replace('/usr', '/opt/extras.ubuntu.com/uberwriter')
39+
python_path.insert(0, opt_path)
40+
sys.path.insert(0, opt_path)
41+
os.putenv("XDG_DATA_DIRS", "%s:%s" % ("/opt/extras.ubuntu.com/uberwriter/share/", os.getenv("XDG_DATA_DIRS", "/usr/local/share/:/usr/share/")))
42+
if (os.path.exists(os.path.join(PROJECT_ROOT_DIRECTORY, 'uberwriter'))
43+
and PROJECT_ROOT_DIRECTORY not in sys.path):
44+
python_path.insert(0, PROJECT_ROOT_DIRECTORY)
45+
sys.path.insert(0, PROJECT_ROOT_DIRECTORY)
46+
if python_path:
47+
os.putenv('PYTHONPATH', "%s:%s" % (os.getenv('PYTHONPATH', ''), ':'.join(python_path))) # for subprocesses
48+
49+
import uberwriter
50+
51+
locale_dir = os.path.abspath(os.path.join(os.path.dirname(uberwriter.__file__),'../po/'))
52+
53+
# L10n
54+
locale.textdomain('uberwriter')
55+
locale.bindtextdomain('uberwriter', locale_dir)
56+
gettext.textdomain('uberwriter')
57+
gettext.bindtextdomain('uberwriter', locale_dir)
58+
59+
uberwriter.main()

data/de.wolfvollprecht.UberWriter.appdata.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
</screenshot>
2929
</screenshots>
3030
<releases>
31+
<release date="2019-04-17" version="2.2.0-beta1">
32+
<description>
33+
<ul>
34+
<li>...</li>
35+
</ul>
36+
</description>
37+
</release>
3138
<release date="2019-03-10" version="2.1.5">
3239
<description>
3340
<ul>

data/de.wolfvollprecht.UberWriter.gschema.xml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,57 @@
22

33
<schemalist>
44

5+
<enum id='de.wolfvollprecht.UberWriter.Stat'>
6+
<value nick='characters' value='0' />
7+
<value nick='words' value='1' />
8+
<value nick='sentences' value='2' />
9+
<value nick='paragraphs' value='3' />
10+
<value nick='read_time' value='4' />
11+
</enum>
12+
513
<schema path="/de/wolfvollprecht/UberWriter/" id="de.wolfvollprecht.UberWriter">
614

15+
<key name='dark-mode-auto' type='b'>
16+
<default>true</default>
17+
<summary>Set dark mode automatically</summary>
18+
<description>
19+
Whether dark mode depends on the system theme, or is set to what the user specifies.
20+
</description>
21+
</key>
722
<key name='dark-mode' type='b'>
823
<default>false</default>
9-
<summary>Dark mode</summary>
24+
<summary>Force dark mode</summary>
1025
<description>
11-
If enabled, the window will be dark themed
12-
If disabled, the window will be light themed
13-
asked to install them manually.
26+
Enable or disable the dark mode.
1427
</description>
1528
</key>
1629
<key name='spellcheck' type='b'>
1730
<default>true</default>
18-
<summary>Spellcheck</summary>
31+
<summary>Check spelling while typing</summary>
1932
<description>
20-
Enable/disable spellchecking in the application.
33+
Enable or disable spellchecking.
2134
</description>
2235
</key>
2336
<key name='gradient-overlay' type='b'>
2437
<default>false</default>
25-
<summary>Show gradient overlay</summary>
38+
<summary>Draw scroll gradient</summary>
2639
<description>
2740
Show a gradient overlay over the text at the top anf bottom of the window.
28-
It can cause performance problems to some users
41+
It can cause performance problems to some users.
42+
</description>
43+
</key>
44+
<key name='input-format' type='s'>
45+
<default>"markdown"</default>
46+
<summary>Input format</summary>
47+
<description>
48+
Input format to use when previewing and exporting using Pandoc.
2949
</description>
3050
</key>
3151
<key name='poll-motion' type='b'>
3252
<default>true</default>
3353
<summary>Allow Uberwriter to poll cursor motion</summary>
3454
<description>
35-
Used for hidding the headerbar after 3 seconds if the cursor is not moving.
55+
Hide the header and status bars if the cursor is not moving.
3656
</description>
3757
</key>
3858
<key name='open-file-path' type='s'>
@@ -42,6 +62,13 @@
4262
Open file paths of the current session
4363
</description>
4464
</key>
65+
<key name='stat-default' enum='de.wolfvollprecht.UberWriter.Stat'>
66+
<default>"words"</default>
67+
<summary>Default statistic</summary>
68+
<description>
69+
Which statistic is shown on the main window.
70+
</description>
71+
</key>
4572

4673
</schema>
4774

data/media/css/_gtk_base.css

Lines changed: 28 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,39 @@
88
bind "<ctl>i" { "insert-italic" () };
99
bind "<ctl>b" { "insert-bold" () };
1010
bind "<ctl>r" { "insert-hrule" () };
11-
bind "<ctl>u" { "insert-ulistitem" () };
12-
bind "<ctl>h" { "insert-heading" () };
11+
bind "<ctl>u" { "insert-listitem" () };
12+
bind "<ctl>h" { "insert-header" () };
1313
bind "<ctl>z" { "undo" () };
1414
bind "<ctl>y" { "redo" () };
15-
bind "<ctl><shift>d" { "insert-strikeout" () };
15+
bind "<ctl><shift>d" { "insert-strikethrough" () };
1616
/*bind "<ctl>t" { "insert-at-cursor" ('[ ] ') };*/
1717
bind "<ctl><shift>z" { "redo" () };
1818
}
1919

2020
/* Main window and text colors */
2121

22-
.uberwriter_window {
22+
.uberwriter-window {
2323
/*border-radius: 7px 7px 3px 3px;*/
2424
background: @background_color;
2525
caret-color: @foreground_color;
2626
}
2727

28-
.uberwriter_window.small .uberwriter-editor {
28+
.uberwriter-window .uberwriter-editor {
2929
font-family: 'Fira Mono', monospace;
30-
font-size: 12px;
31-
}
32-
.uberwriter_window grid {
33-
background-color: @background_color;
30+
font-size: 16px;
31+
padding-top: 80px;
32+
padding-bottom: 16px;
3433
}
3534

36-
#UberwriterWindow.medium .uberwriter-editor {
37-
font-family: 'Fira Mono', monospace;
38-
font-size: 15px;
35+
.uberwriter-window.small .uberwriter-editor {
36+
font-size: 14px;
3937
}
4038

41-
#UberwriterWindow.large .uberwriter-editor {
42-
font-family: 'Fira Mono', monospace;
39+
.uberwriter-window.large .uberwriter-editor {
4340
font-size: 18px;
4441
}
4542

46-
#titlebar_revealer {
43+
#titlebar-revealer {
4744
padding: 0;
4845
}
4946

@@ -52,8 +49,8 @@
5249
background: transparent;
5350
}
5451

55-
#titlebar_container {
56-
background: @background_color;
52+
#titlebar-container {
53+
background: @background_color;
5754
}
5855

5956
.uberwriter-editor {
@@ -89,15 +86,10 @@
8986
}
9087

9188

92-
.status_bar_box label {
93-
color: #666;
94-
}
95-
96-
.status_bar_box button {
97-
/* finding reset */
89+
.stats-counter {
90+
color: alpha(@foreground_color, 0.6);
9891
background-color: @background_color;
9992
text-shadow: inherit;
100-
/*icon-shadow: inherit;*/
10193
box-shadow: initial;
10294
background-clip: initial;
10395
background-origin: initial;
@@ -109,37 +101,15 @@
109101
border-image-repeat: initial;
110102
border-image-slice: initial;
111103
border-image-width: initial;
112-
113104
border-style: none;
114-
-button-images: true;
115-
border-radius: 2px;
116-
color: #666;
117-
padding: 3px 5px;
105+
padding: 0px 16px;
118106
transition: 100ms ease-in;
119107
}
120108

121-
.status_bar_box button:hover,
122-
.status_bar_box button:checked {
123-
transition: 0s ease-in;
124-
color: @background_color;
125-
background-color: #666;
126-
}
127-
128-
.status_bar_box button:hover label,
129-
.status_bar_box button:checked label {
130-
color: @background_color;
131-
}
132-
133-
.status_bar_box button:active {
134-
color: #EEE;
135-
background-color: #EEE;
136-
background-image: none;
137-
box-shadow: 0 0 2px rgba(0,0,0,0.4)
138-
}
139-
140-
.status_bar_box separator {
141-
border-color: #999;
142-
border-right: none;
109+
.stats-counter:hover,
110+
.stats-counter:checked {
111+
color: @foreground_color;
112+
background-color: lighter(@background_color);
143113
}
144114

145115
#PreviewMenuItem image {
@@ -150,7 +120,7 @@
150120
background: #FFF;
151121
}
152122

153-
#UberwriterWindow treeview {
123+
.uberwriter-window treeview {
154124
padding: 3px 3px 3px 3px;
155125
}
156126

@@ -165,7 +135,7 @@
165135
padding: 5px;
166136
}
167137

168-
/* .QuickPreviewPopup {
138+
/* .quick-preview-popup {
169139
padding: 5px;
170140
margin: 5px;
171141
border: 1px solid #333;
@@ -183,8 +153,7 @@
183153
border: 5px solid @background_color;
184154
}
185155

186-
#LexikonBubble .lexikon_heading {
187-
/*font: serif 12;*/
156+
#LexikonBubble .lexikon-heading {
188157
font-family: serif;
189158
font-size: 12px;
190159
padding-bottom: 5px;
@@ -193,21 +162,21 @@
193162
padding-left: 10px;
194163
}
195164

196-
#LexikonBubble .lexikon_num {
165+
#LexikonBubble .lexikon-num {
197166
padding-right: 5px;
198167
padding-left: 20px;
199168
}
200169

201-
.QuickPreviewPopup {
170+
.quick-preview-popup {
202171
background-color: @background_color;
203172
}
204173

205-
.QuickPreviewPopup grid {
174+
.quick-preview-popup grid {
206175
background-color: @background_color;
207176
color: @foreground_color;
208177
border-color: @background_color;
209178
}
210179

211-
.QuickPreviewPopup label {
180+
.quick-preview-popup label {
212181
color: @foreground_color;
213182
}

0 commit comments

Comments
 (0)