mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Merge remote-tracking branch 'offical/master'
This commit is contained in:
+11
@@ -79,11 +79,22 @@ Application_setActivationPolicy :: proc "c" (self: ^Application, activationPolic
|
||||
return msgSend(BOOL, self, "setActivationPolicy:", activationPolicy)
|
||||
}
|
||||
|
||||
@(deprecated="Use NSApplication method activate instead.")
|
||||
@(objc_type=Application, objc_name="activateIgnoringOtherApps")
|
||||
Application_activateIgnoringOtherApps :: proc "c" (self: ^Application, ignoreOtherApps: BOOL) {
|
||||
msgSend(nil, self, "activateIgnoringOtherApps:", ignoreOtherApps)
|
||||
}
|
||||
|
||||
@(objc_type=Application, objc_name="activate")
|
||||
Application_activate :: proc "c" (self: ^Application) {
|
||||
msgSend(nil, self, "activate")
|
||||
}
|
||||
|
||||
@(objc_type=Application, objc_name="setTitle")
|
||||
Application_setTitle :: proc "c" (self: ^Application, title: ^String) {
|
||||
msgSend(nil, self, "setTitle", title)
|
||||
}
|
||||
|
||||
@(objc_type=Application, objc_name="setMainMenu")
|
||||
Application_setMainMenu :: proc "c" (self: ^Application, menu: ^Menu) {
|
||||
msgSend(nil, self, "setMainMenu:", menu)
|
||||
|
||||
Vendored
+9
-9
@@ -1316,10 +1316,10 @@ begin_window :: proc(ctx: ^Context, title: string, rect: Rect, opt := Options{})
|
||||
|
||||
/* do title text */
|
||||
if .NO_TITLE not_in opt {
|
||||
id := get_id(ctx, "!title")
|
||||
update_control(ctx, id, tr, opt)
|
||||
tid := get_id(ctx, "!title")
|
||||
update_control(ctx, tid, tr, opt)
|
||||
draw_control_text(ctx, title, tr, .TITLE_TEXT, opt)
|
||||
if id == ctx.focus_id && ctx.mouse_down_bits == {.LEFT} {
|
||||
if tid == ctx.focus_id && ctx.mouse_down_bits == {.LEFT} {
|
||||
cnt.rect.x += ctx.mouse_delta.x
|
||||
cnt.rect.y += ctx.mouse_delta.y
|
||||
}
|
||||
@@ -1329,12 +1329,12 @@ begin_window :: proc(ctx: ^Context, title: string, rect: Rect, opt := Options{})
|
||||
|
||||
/* do `close` button */
|
||||
if .NO_CLOSE not_in opt {
|
||||
id := get_id(ctx, "!close")
|
||||
cid := get_id(ctx, "!close")
|
||||
r := Rect{tr.x + tr.w - tr.h, tr.y, tr.h, tr.h}
|
||||
tr.w -= r.w
|
||||
draw_icon(ctx, .CLOSE, r, ctx.style.colors[.TITLE_TEXT])
|
||||
update_control(ctx, id, r, opt)
|
||||
if .LEFT in ctx.mouse_released_bits && id == ctx.hover_id {
|
||||
update_control(ctx, cid, r, opt)
|
||||
if .LEFT in ctx.mouse_released_bits && cid == ctx.hover_id {
|
||||
cnt.open = false
|
||||
}
|
||||
}
|
||||
@@ -1343,11 +1343,11 @@ begin_window :: proc(ctx: ^Context, title: string, rect: Rect, opt := Options{})
|
||||
/* do `resize` handle */
|
||||
if .NO_RESIZE not_in opt {
|
||||
sz := ctx.style.footer_height
|
||||
id := get_id(ctx, "!resize")
|
||||
rid := get_id(ctx, "!resize")
|
||||
r := Rect{rect.x + rect.w - sz, rect.y + rect.h - sz, sz, sz}
|
||||
draw_icon(ctx, .RESIZE, r, ctx.style.colors[.TEXT])
|
||||
update_control(ctx, id, r, opt)
|
||||
if id == ctx.focus_id && .LEFT in ctx.mouse_down_bits {
|
||||
update_control(ctx, rid, r, opt)
|
||||
if rid == ctx.focus_id && .LEFT in ctx.mouse_down_bits {
|
||||
cnt.rect.w = max(96, cnt.rect.w + ctx.mouse_delta.x)
|
||||
cnt.rect.h = max(64, cnt.rect.h + ctx.mouse_delta.y)
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -2009,7 +2009,7 @@ __expandStroke :: proc(
|
||||
}
|
||||
}
|
||||
|
||||
for j in start..<end {
|
||||
for _ in start..<end {
|
||||
// TODO check this
|
||||
// if ((p1.flags & (NVG_PT_BEVEL | NVG_PR_INNERBEVEL)) != 0) {
|
||||
if (.BEVEL in p1.flags) || (.INNER_BEVEL in p1.flags) {
|
||||
@@ -2172,7 +2172,7 @@ __expandFill :: proc(
|
||||
__vset(&dst, verts[dst_index + 0].x, verts[dst_index + 0].y, lu, 1)
|
||||
__vset(&dst, verts[dst_index + 1].x, verts[dst_index + 1].y, ru, 1)
|
||||
|
||||
dst_diff := dst_start_length - len(dst)
|
||||
dst_diff = dst_start_length - len(dst)
|
||||
path.stroke = verts[dst_index:dst_index + dst_diff]
|
||||
|
||||
// advance
|
||||
@@ -3361,7 +3361,7 @@ TextBoxBounds :: proc(
|
||||
rows_mod := rows[:]
|
||||
y := y
|
||||
|
||||
for nrows, input_last in TextBreakLines(ctx, &input, breakRowWidth, &rows_mod) {
|
||||
for nrows in TextBreakLines(ctx, &input, breakRowWidth, &rows_mod) {
|
||||
for row in rows[:nrows] {
|
||||
rminx, rmaxx, dx: f32
|
||||
|
||||
|
||||
Vendored
+1
@@ -34,6 +34,7 @@ foreign lib {
|
||||
SemWait :: proc(s: ^sem) -> c.int ---
|
||||
SemTryWait :: proc(s: ^sem) -> c.int ---
|
||||
SemWaitTimeout :: proc(s: ^sem, ms: u32) -> c.int ---
|
||||
SemPost :: proc(s: ^sem) -> c.int ---
|
||||
SemValue :: proc(s: ^sem) -> u32 ---
|
||||
|
||||
CreateCond :: proc() -> ^cond ---
|
||||
|
||||
Reference in New Issue
Block a user