Skip to content

Commit

Permalink
[feat] SDL2: framebuffer:setWindowTitle() (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frenzie committed Mar 21, 2018
1 parent 441221e commit 3fed4df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ffi/framebuffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,18 @@ function fb:setScreenMode(mode)
end
end
function fb:getWindowTitle()
return self.window_title
end
function fb:setWindowTitle(new_title)
if new_title and new_title ~= "" then
self.window_title = new_title .. " - KOReader"
else
self.window_title = "KOReader"
end
end
function fb:toggleNightMode()
self.bb:invert()
if self.viewport then
Expand Down
5 changes: 5 additions & 0 deletions ffi/framebuffer_SDL2_0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ function framebuffer:refreshFullImp(x, y, w, h)
self:_render(bb)
end

function framebuffer:setWindowTitle(new_title)
framebuffer.parent.setWindowTitle(self, new_title)
SDL.SDL.SDL_SetWindowTitle(SDL.screen, self.window_title)
end

function framebuffer:close()
SDL.SDL.SDL_Quit()
end
Expand Down

0 comments on commit 3fed4df

Please sign in to comment.