-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some patch code for tab and table #56
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ import ( | |
"strconv" | ||
|
||
"github.com/richardwilkes/toolbox/i18n" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this empty line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is goland's import grouping, it will also automatically separate it if you change it manually |
||
"github.com/richardwilkes/unison/enums/paintstyle" | ||
) | ||
|
||
|
@@ -49,6 +50,11 @@ type dockHeader struct { | |
dragInsertIndex int | ||
} | ||
|
||
func (d *dockHeader) CurrentDockTabLabel() *Label { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? If you want to know the title of the current tab, you can call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, title is just a string not a panel, we need to get the label where the title is located in order to add a context menu in its coordinates to close all the tabs with one click. |
||
index := d.owner.CurrentDockableIndex() | ||
tabs, _ := d.partition() | ||
return tabs[index].title | ||
} | ||
func newDockHeader(dc *DockContainer) *dockHeader { | ||
d := &dockHeader{ | ||
DockHeaderTheme: DefaultDockHeaderTheme, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ import ( | |
"strings" | ||
|
||
"github.com/richardwilkes/toolbox" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this empty line. |
||
"github.com/richardwilkes/unison/enums/pathop" | ||
) | ||
|
||
|
@@ -68,6 +69,10 @@ type Panel struct { | |
TooltipImmediate bool | ||
} | ||
|
||
func (p *Panel) SetParent(panel *Panel) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I think I've stated before, I will not add a |
||
p.parent = panel | ||
} | ||
|
||
// NewPanel creates a new panel. | ||
func NewPanel() *Panel { | ||
p := &Panel{} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning a private struct from a public API is not acceptable. Why do you feel you need to get access to this private, internal, field? It is being protected specifically to help prevent unexpected changes to its state and as such, I'm unlikely to want it exposed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this action there is no way to fetch the dock title's panel