Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for new tab opening when double clicking scrollbar.

This only now occurs when clicking on the empty part of the GtkNotebook.
  • Loading branch information...
commit 680ce5e53bd19e32366bfd5d304fcf571395ab90 1 parent b0f8de0
Dominik Picheta dom96 authored
Showing with 13 additions and 3 deletions.
  1. +9 −1 aporia.nim
  2. +4 −1 changelog.markdown
  3. +0 −1  utils.nim
10 aporia.nim
View
@@ -1033,6 +1033,15 @@ proc tab_buttonRelease(widg: PWidget, ev: PEventButton,
proc onTabsPressed(widg: PWidget, ev: PEventButton,
userDat: pwidget):bool =
if ev.button == 1 and ev.`type` == BUTTON2_PRESS:
+ let galloc = win.tabs[win.tabs.len-1].closeBtn.allocation
+ if galloc.x == -1:
+ # Use the label x instead
+ let labelAlloc = win.tabs[win.tabs.len-1].label.allocation
+ assert labelAlloc.x != -1
+ if ev.x < labelAlloc.x.float: return # Didn't click on empty space.
+ else:
+ if ev.x < galloc.x.float: return # Didn't click on empty space.
+
addTab("", "", true)
proc onSwitchTab(notebook: PNotebook, page: PNotebookPage, pageNum: guint,
@@ -1463,7 +1472,6 @@ proc initSourceViewTabs() =
discard win.sourceViewTabs.signalConnect("page-reordered",
SIGNAL_FUNC(onPageReordered), nil)
- # TODO: only create new tab when double-clicking in empty space
discard win.SourceViewTabs.signalConnect("button-press-event",
SIGNAL_FUNC(onTabsPressed), nil)
5 changelog.markdown
View
@@ -12,4 +12,7 @@ open documents from the file manager and it will open in the same aporia window.
* Pragmas can now be colored using the "nimrod:pragma" style name.
* Whole blocks and lines of code can now be commented using Ctrl + /.
* Tabs and two consecutive underscores are now highlighted as errors when using
-the Nimrod syntax highlighter.
+the Nimrod syntax highlighter.
+* Recent file list in File menu.
+* Fixed a bug where clicking a new tab would be created when double clicking on
+ the scrollbar.
1  utils.nim
View
@@ -319,4 +319,3 @@ proc getCurrentLanguageComment*(win: var MainWin,
syntax.blockStart = ""
syntax.blockEnd = ""
syntax.line = ""
- echod(currentLang, " ", repr(syntax))
Please sign in to comment.
Something went wrong with that request. Please try again.