bugfix
This commit is contained in:
parent
32f8f4bc64
commit
ca1b329a49
6037
kivyblocks/blocks.c
6037
kivyblocks/blocks.c
File diff suppressed because it is too large
Load Diff
@ -23,17 +23,8 @@ from kivy.uix.modalview import ModalView
|
||||
from kivy.app import App
|
||||
from kivy.factory import Factory
|
||||
from kivy.uix.video import Video
|
||||
from .baseWidget import *
|
||||
from .toolbar import *
|
||||
from .dg import DataGrid
|
||||
from .utils import *
|
||||
from .serverImageViewer import ServerImageViewer
|
||||
from .vplayer import VPlayer
|
||||
from .form import InputBox, Form, StrSearchForm
|
||||
from .boxViewer import BoxViewer
|
||||
from .tree import Tree, TextTree
|
||||
from .newvideo import Video
|
||||
from .bgcolorbehavior import BGColorBehavior
|
||||
from .orientationlayout import OrientationLayout
|
||||
from .threadcall import HttpClient
|
||||
from .register import *
|
||||
|
@ -109,23 +109,12 @@ class BoxViewer(VBox):
|
||||
if dir == 'up':
|
||||
recs.reverse()
|
||||
idx = -1
|
||||
recs1 = recs[:self.show_rows]
|
||||
recs2 = recs[self.show_rows:]
|
||||
self._fbo = Fbo(size=self.size)
|
||||
with self._fbo:
|
||||
self._background_color = Color(0,0,0,1)
|
||||
self._background_rect = Rectangle(size=self.size)
|
||||
for r in recs1:
|
||||
self.showObject(widgets, r, index=idx)
|
||||
with self.canvas:
|
||||
self._fbo_rect = Rectangle(size=self.size,
|
||||
texture=self._fbo.texture)
|
||||
with self.fboContext():
|
||||
for r in recs:
|
||||
self.showObject(widgets, r, index=idx)
|
||||
|
||||
data['widgets'] = widgets
|
||||
data['idx'] = idx
|
||||
data['data'] = recs2
|
||||
f = partial(self.add_page_delay, data)
|
||||
Clock.schedule_once(f, 0)
|
||||
|
||||
def add_page_delay(self, data, *args):
|
||||
recs = data['data']
|
||||
@ -182,11 +171,7 @@ class BoxViewer(VBox):
|
||||
|
||||
def showObject(self, holders, rec,index=0):
|
||||
opts = {
|
||||
"size_hint":[None,None],
|
||||
"height":self.box_height,
|
||||
"width":self.box_width,
|
||||
"color_level":self.color_level,
|
||||
"radius":self.radius
|
||||
"csscls":self.viewer_css
|
||||
}
|
||||
desc = {
|
||||
"widgettype":"PressableBox",
|
||||
|
5285
kivyblocks/dg.c
5285
kivyblocks/dg.c
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,6 @@ from kivy.app import App
|
||||
from kivy.factory import Factory
|
||||
|
||||
from appPublic.dictObject import DictObject
|
||||
from appPublic.timecost import TimeCost
|
||||
from appPublic.uniqueID import getID
|
||||
from appPublic.myTE import string_template_render
|
||||
|
||||
|
@ -317,6 +317,7 @@ class Form(WidgetCSS, WidgetReady, BoxLayout):
|
||||
desc['tool_orient'] = 'veritcal'
|
||||
|
||||
self.toolbar_w = Factory.Toolbar(**desc)
|
||||
print('box_width=', self.input_width)
|
||||
self.fsc = VResponsiveLayout(
|
||||
box_width = self.input_width,
|
||||
size_hint=(1,1)
|
||||
|
@ -14,6 +14,8 @@ from .clickable import SingleCheckBox
|
||||
from .baseWidget import Text
|
||||
from .utils import CSize
|
||||
|
||||
from appPublic.registerfunction import getRegisterFunctionByName
|
||||
|
||||
class TreeViewComplexNode(BoxLayout, TreeViewLabel):
|
||||
otext = StringProperty(None)
|
||||
checkbox = BooleanProperty(False)
|
||||
|
@ -26,31 +26,44 @@ class VResponsiveLayout(WidgetCSS, WidgetReady, ScrollView):
|
||||
super(VResponsiveLayout,self).add_widget(self._inner)
|
||||
self._inner.bind(
|
||||
minimum_height=self._inner.setter('height'))
|
||||
self.setCols()
|
||||
self.bind(pos=self.setCols,size=self.setCols)
|
||||
self.bind(pos=self.set_col_width_cnt,size=self.set_col_width_cnt)
|
||||
|
||||
def on_box_width_c(self, *args):
|
||||
print('on_box_width_c fire......')
|
||||
if self.box_width_c is None:
|
||||
return
|
||||
if self.box_width:
|
||||
return
|
||||
if not self._inner:
|
||||
return
|
||||
self.col_width = CSize(self.box_width)
|
||||
self.col_width_hint = False
|
||||
self.set_cols()
|
||||
self.set_col_width_cnt()
|
||||
|
||||
def on_box_width(self, *args):
|
||||
print('on_box_width fire......')
|
||||
if not self._inner:
|
||||
return
|
||||
if self.box_width is None:
|
||||
return
|
||||
if self.box_width <= 1:
|
||||
self.col_width = self.box_width
|
||||
self.col_width_hint = self.box_width
|
||||
self.col_width_hint = True
|
||||
else:
|
||||
self.col_width = self.box_width
|
||||
self.col_width_hint = False
|
||||
self.set_cols()
|
||||
self.col_width_hint = False
|
||||
self.set_col_width_cnt()
|
||||
|
||||
def calculate_col_width(self):
|
||||
# cnt * col_width + 2*padding + (cnt-1) * spacing = width
|
||||
w = self._inner
|
||||
width = w.width - 2 * w.padding
|
||||
if len(w.padding) == 1:
|
||||
width = w.width - 2 * w.padding
|
||||
return width * self.col_width
|
||||
if len(w.padding) == 2:
|
||||
width = w.width - 2 * w.padding[0]
|
||||
return width * self.col_width
|
||||
width = w.width - w.padding[0] - w.padding[2]
|
||||
return width * self.col_width
|
||||
|
||||
def get_col_width(self):
|
||||
@ -59,9 +72,31 @@ class VResponsiveLayout(WidgetCSS, WidgetReady, ScrollView):
|
||||
def get_cols(self):
|
||||
return self._inner.cols
|
||||
|
||||
def set_col_width_cnt(self):
|
||||
def set_col_width(self):
|
||||
if self.box_width_c is not None:
|
||||
self.col_width = CSize(self.box_width)
|
||||
self.col_width_hint = False
|
||||
return
|
||||
if self.box_width is not None:
|
||||
if self.box_width <= 1:
|
||||
self.col_width = self.box_width
|
||||
self.col_width_hint = True
|
||||
else:
|
||||
self.col_width = self.box_width
|
||||
self.col_width_hint = False
|
||||
return
|
||||
|
||||
|
||||
def set_col_width_cnt(self, *args):
|
||||
print('set_col_width_cnt() called .....')
|
||||
if self.col_width is None:
|
||||
self.set_col_width()
|
||||
if self.col_width is None:
|
||||
return
|
||||
|
||||
if self.col_width_hint:
|
||||
self._inner.col_default_width = self.calc_col_width()
|
||||
self._inner.col_default_width = \
|
||||
self.calculate_col_width()
|
||||
else:
|
||||
self._inner.col_default_width = self.col_width
|
||||
self.setCols()
|
||||
@ -70,7 +105,7 @@ class VResponsiveLayout(WidgetCSS, WidgetReady, ScrollView):
|
||||
w.width = self._inner.col_default_width
|
||||
|
||||
def on_orientation(self,o):
|
||||
self.setCols()
|
||||
self.set_col_width_cnt()
|
||||
|
||||
def add_widget(self,widget,**kw):
|
||||
a = self._inner.add_widget(widget,**kw)
|
||||
|
Loading…
Reference in New Issue
Block a user