166 Commits

Author SHA1 Message Date
Le Tan
385abb3041 hide image preview block when selected
We do not want user to copy the image preview block (a special char).

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-31 14:13:42 +08:00
Le Tan
059e8dacd2 change cursorline color in Vim mode
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-29 22:23:20 +08:00
Le Tan
72fdf399bc change app icon
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-29 21:26:39 +08:00
Le Tan
becd4a320f support Vim key bindings in preview mode
1. h, j, k, l to navigate;
2. gg, G to go to the start and end of the document;
3. Ctrl+D, Ctrl+U to go down and up half page;

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-29 20:52:18 +08:00
Le Tan
880d16e8f4 support reordering notes in file list panel
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-28 19:02:27 +08:00
Le Tan
c44928e1d8 remove Ctrl+Alt Vim mode
1. Remove Ctrl+ALT Vim mode. Now Ctrl+D will enter the Vim mode
tempararily and only expires after NOT hitting commands for a while;
2. Add d and dd to delete text. 'd2j' is not supported;
3. x will cut the selected text.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-27 09:59:26 +08:00
Le Tan
3b442f55a9 highlight curren cursor line
Add configuration "highlight_cursor_line" in vnote.ini.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-25 20:31:59 +08:00
Le Tan
76bd2c7d64 support more Vim key bindings
1. Esc or Ctrl + [ to clear selection or exit Vim mode;
2. v to enter visual mode;
3. y to copy selected text; "y2j" is not supported yet;

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-25 11:24:49 +08:00
Le Tan
58c8506855 use different color of the corner icon in current window
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-24 15:52:05 +08:00
Le Tan
16858d7474 support moving tabs between windows
Add two menu item on the tab's context menu to move one split
left/right.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-24 15:02:14 +08:00
Le Tan
1aa264adc8 support locating current note
Support locating the notebook and directory of current note.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-24 13:09:19 +08:00
Le Tan
b14d15e266 add icon to indicate the read/edit mode of tab
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-24 09:32:56 +08:00
Le Tan
d4fe99b8bb preserve the expand/collapse state while switching notebook
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-23 22:12:17 +08:00
Le Tan
52af2ef9e9 add more Vim mode key bindings
1. x, w, e, b;
2. gg, G;
2. 0, $, ^;

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-22 22:33:16 +08:00
Le Tan
9d975c4bdb Refine Ctrl+B and Ctrl+I
If there are ** or * after current cursor, just skip them or it when
hitting Ctrl+B or Ctrl+I.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-21 21:39:09 +08:00
Le Tan
3ce9f02007 clear corrupted image preview block
Users may add some texts in the image preview block around the image. In
this case, we should just delete the image and insert another preview
block.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-21 21:37:33 +08:00
Le Tan
26016dd44a support Vim mode key bindings
After hitting `Ctrl+D` or keeping pressing `Ctrl+Alt`, VNote will enter Vim
normal pending mode.

1. Support <num>h,j,k,l to move cursor around;

TODO: Design a finite state machine to handle more Vim commands
elegantly.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-20 22:23:41 +08:00
Le Tan
d2f61bc605 add shortcuts
1. `Ctrl + W`, `Ctrl + R`, `Ctrl + Q`, `Ctrl + S` for edit and view mode;
2. `Ctrl + E` to toggle expand view;
3. `Ctrl + N` to create note in current directory;
4. `Ctrl + H` in edit mode to delete previous char;
5. `Ctrl + W` in edit mode to delete till the start of previous word;
6. `Ctrl + U` in edit mode to delete till the start of current line;
7. `Tab`, `Shift + Tab` to indent or unindent selected lines;
8. `Ctrl + B`, `Ctrl + I` to make selected text bold or italic;

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-18 22:26:01 +08:00
Le Tan
87c668bc67 fix Hoedown's toc
Hoedown will treat '_' in title as '<em>'.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-17 12:57:06 +08:00
Le Tan
a22bf1059d preview image links
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-17 12:38:01 +08:00
Le Tan
e069305b23 menu and actions text normalization
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-13 21:41:17 +08:00
Le Tan
5ff46d6237 implement insert image menu action
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-12 23:14:53 +08:00
Le Tan
66c1d543c2 synchronize current header in read and edit mode
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-12 21:58:53 +08:00
Le Tan
a884991150 refactor: add VMdEdit to inherit VEdit for markdown edit
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-11 14:42:01 +08:00
Le Tan
6a745df2eb combine save and discard tool buttons
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-10 18:08:03 +08:00
Le Tan
a0a558d62d change the size of the down-arrow in VNotebookSelector
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-10 17:49:14 +08:00
Le Tan
68e6a214e9 combine view panel actions in toolbar
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-10 17:24:33 +08:00
Le Tan
f36ed97694 change stylesheet
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-10 16:41:13 +08:00
Le Tan
b0ec4c312a support import existing notebook
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-10 15:41:46 +08:00
Le Tan
5d028e29fb change icon
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-10 13:03:57 +08:00
Le Tan
67c1f69a5b disable context menu on QMainWindow to prevent hiding the toolbar
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-10 11:28:10 +08:00
Le Tan
edca922f5e support avatar
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-10 11:21:08 +08:00
Le Tan
8f866f34ff stylesheet
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-09 21:08:38 +08:00
Le Tan
3ecae78262 add tooltip in VOutline
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-08 23:20:19 +08:00
Le Tan
8b26e4424d use bold to identify current tab in corner widget
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-08 23:17:45 +08:00
Le Tan
f0428f7b90 change markdown.css
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-08 23:11:14 +08:00
Le Tan
9413ef875b modify stylesheet
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-08 22:42:34 +08:00
Le Tan
a3b83b7f81 dynamically show or hide left corner tab list widget
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-07 22:53:02 +08:00
Le Tan
6c72267788 add padding to QTreeWidgetItem and QListWidgetItem
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-07 22:01:58 +08:00
Le Tan
e32ee1fa90 refactor: VNotebookSelector
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-07 13:08:06 +08:00
Le Tan
9a197b5087 refactor: add VNotebookSelector for notebook management
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-04 22:26:48 +08:00
Le Tan
fe4fb25105 VOutline: change current anchor when current item changed
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-03 20:26:05 +08:00
Le Tan
46c8025215 enable multiple selection in file list
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-03 17:42:09 +08:00
Le Tan
02d5300821 support copy and paste directory
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-03 11:42:11 +08:00
Le Tan
787d54c808 update tab list menu dynamically when menu show up
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-30 23:38:29 +08:00
Le Tan
e7c42ba5be refactor: add VFile and VDirectory
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-30 22:58:00 +08:00
Le Tan
8e8d69c85f refactor: VNote and VNotebook
regression: notebook renaming logics does not work for now

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-26 12:45:29 +08:00
Le Tan
013b6cecc2 install a message handler
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-24 22:49:31 +08:00
Le Tan
7c69f80f17 split setupUI() in VMainWindow
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-24 22:23:50 +08:00
Le Tan
f37d1f57a8 fix regular expression in image-insert dialog
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-23 21:39:20 +08:00