Skip to content
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

Add 1x3 portrait layout #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion camplayer/backgroundgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def NOLINK(cls, window_count):

_map = ({
1: cls.NOLINK_1X1,
3: cls.NOLINK_1X1,
4: cls.NOLINK_2X2,
6: cls.NOLINK_1P5,
7: cls.NOLINK_3P4,
Expand Down Expand Up @@ -322,4 +323,4 @@ def destroy(cls):
if CONFIG.BACKGROUND_MODE == BACKGROUND.DYNAMIC:
for display_idx in range(GLOBALS.NUM_DISPLAYS):
if cls._proc_background[display_idx]:
cls._proc_background[display_idx].stdin.write("c".encode('utf-8'))
cls._proc_background[display_idx].stdin.write("c".encode('utf-8'))
31 changes: 31 additions & 0 deletions camplayer/screenmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,36 @@ def _load_windows(self):
nrows_ncolums = 1
self.grid_size = [9, 16]

elif self.layout == LAYOUT._1X3:
nrows_ncolums = 3
self.grid_size = [1, 3]
self.windows.append(Window(
x1=CONSTANTS.VIRT_SCREEN_OFFSET_X,
y1=CONSTANTS.VIRT_SCREEN_OFFSET_Y,
x2=int(CONSTANTS.VIRT_SCREEN_OFFSET_X + CONSTANTS.VIRT_SCREEN_WIDTH),
y2=int(CONSTANTS.VIRT_SCREEN_OFFSET_Y + (CONSTANTS.VIRT_SCREEN_HEIGHT / 3)),
gridindex=[0],
screen_idx=self._screen_idx,
window_idx=len(self.windows),
display_idx=self._display_idx))
self.windows.append(Window(
x1=CONSTANTS.VIRT_SCREEN_OFFSET_X,
y1=CONSTANTS.VIRT_SCREEN_OFFSET_Y + (CONSTANTS.VIRT_SCREEN_HEIGHT / 3),
x2=int(CONSTANTS.VIRT_SCREEN_OFFSET_X + CONSTANTS.VIRT_SCREEN_WIDTH),
y2=int(CONSTANTS.VIRT_SCREEN_OFFSET_Y + (CONSTANTS.VIRT_SCREEN_HEIGHT * 2 / 3)),
gridindex=[1],
screen_idx=self._screen_idx,
window_idx=len(self.windows),
display_idx=self._display_idx))
self.windows.append(Window(
x1=CONSTANTS.VIRT_SCREEN_OFFSET_X,
y1=CONSTANTS.VIRT_SCREEN_OFFSET_Y + (CONSTANTS.VIRT_SCREEN_HEIGHT * 2 / 3),
x2=int(CONSTANTS.VIRT_SCREEN_OFFSET_X + CONSTANTS.VIRT_SCREEN_WIDTH),
y2=int(CONSTANTS.VIRT_SCREEN_OFFSET_Y + CONSTANTS.VIRT_SCREEN_HEIGHT),
gridindex=[2],
screen_idx=self._screen_idx,
window_idx=len(self.windows),
display_idx=self._display_idx))
elif self.layout == LAYOUT._2X2:
nrows_ncolums = 2
self.grid_size = [16]
Expand Down Expand Up @@ -531,6 +561,7 @@ def _load_windows(self):
(self.layout == LAYOUT._2P8 and column > 1) or
(self.layout == LAYOUT._3P4 and (column > 1 and row > 1)) or
(self.layout == LAYOUT._1X1) or
(self.layout == LAYOUT._1X3) or
(self.layout == LAYOUT._2X2) or
(self.layout == LAYOUT._3X3) or
(self.layout == LAYOUT._4X4)):
Expand Down
1 change: 1 addition & 0 deletions camplayer/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@unique
class LAYOUT(IntEnum):
_1X1 = 1
_1X3 = 3
_2X2 = 4
_3X3 = 9
_1P5 = 6
Expand Down