Panes: new content_[left/right]_min_[relative]_size properties

This commit is contained in:
Davide Andreoli 2014-07-31 17:01:53 +02:00
parent f9247fa99f
commit 1af5adb8cd
4 changed files with 78 additions and 5 deletions

View File

@ -1107,6 +1107,8 @@ cdef class Map(Object):
:param lat: The latitude to center at
:type lat: float
.. versionadded:: 1.11
"""
elm_map_region_zoom_bring_in(self.obj, zoom, lon, lat)

View File

@ -1,4 +1,4 @@
from efl.evas cimport Eina_Bool, Evas_Object
from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord
cdef extern from "Elementary.h":
Evas_Object *elm_panes_add(Evas_Object *parent)
@ -8,5 +8,13 @@ cdef extern from "Elementary.h":
void elm_panes_content_left_size_set(Evas_Object *obj, double size)
double elm_panes_content_right_size_get(const Evas_Object *obj)
void elm_panes_content_right_size_set(Evas_Object *obj, double size)
void elm_panes_content_left_min_relative_size_set(Evas_Object *obj, double size)
double elm_panes_content_left_min_relative_size_get(const Evas_Object *obj)
void elm_panes_content_right_min_relative_size_set(Evas_Object *obj, double size)
double elm_panes_content_right_min_relative_size_get(const Evas_Object *obj)
void elm_panes_content_left_min_size_set(Evas_Object *obj, Evas_Coord size)
Evas_Coord elm_panes_content_left_min_size_get(const Evas_Object *obj)
void elm_panes_content_right_min_size_set(Evas_Object *obj, Evas_Coord size)
Evas_Coord elm_panes_content_right_min_size_get(const Evas_Object *obj)
void elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
Eina_Bool elm_panes_horizontal_get(const Evas_Object *obj)

View File

@ -125,6 +125,68 @@ cdef class Panes(LayoutClass):
def __set__(self, size):
elm_panes_content_right_size_set(self.obj, size)
property content_left_min_relative_size:
"""The relative minimum size of panes widget's left side.
The value must be between 0.0 and 1.0 representing size
proportion of minimum size of left side.
:type: float
.. versionadded:: 1.11
"""
def __get__(self):
return elm_panes_content_left_min_relative_size_get(self.obj)
def __set__(self, size):
elm_panes_content_left_min_relative_size_set(self.obj, size)
property content_right_min_relative_size:
"""The relative minimum size of panes widget's right side.
The value must be between 0.0 and 1.0 representing size
proportion of minimum size of right side.
:type: float
.. versionadded:: 1.11
"""
def __get__(self):
return elm_panes_content_right_min_relative_size_get(self.obj)
def __set__(self, size):
elm_panes_content_right_min_relative_size_set(self.obj, size)
property content_left_min_size:
"""The absolute minimum size of panes widget's left side.
The value represent the minimum size of left side in pixels.
:type: int
.. versionadded:: 1.11
"""
def __get__(self):
return elm_panes_content_left_min_size_get(self.obj)
def __set__(self, size):
elm_panes_content_left_min_size_set(self.obj, size)
property content_right_min_size:
"""The absolute minimum size of panes widget's right side.
The value represent the minimum size of right side in pixels.
:type: int
.. versionadded:: 1.11
"""
def __get__(self):
return elm_panes_content_right_min_size_get(self.obj)
def __set__(self, size):
elm_panes_content_right_min_size_set(self.obj, size)
property horizontal:
"""The orientation of a given panes widget.

View File

@ -18,7 +18,8 @@ def panes_clicked(obj):
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
panes = Panes(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
panes = Panes(win, content_left_min_relative_size=0.3,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
win.resize_object_add(panes)
panes.callback_clicked_add(cb_panes, "clicked")
panes.callback_clicked_double_add(cb_panes, "clicked,double")
@ -30,9 +31,9 @@ def panes_clicked(obj):
panes.part_content_set("left", bt)
bt.show()
panes_h = Panes(win, horizontal=True, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
panes_h.horizontal = True
panes_h = Panes(win, horizontal=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
content_left_min_size=30, content_right_min_size=100)
panes.part_content_set("right", panes_h)
panes_h.show()