This commit is contained in:
yumoqing 2022-02-09 13:51:44 +08:00
parent 32f8f4bc64
commit ca1b329a49
8 changed files with 5569 additions and 5844 deletions

File diff suppressed because it is too large Load Diff

View File

@ -23,17 +23,8 @@ from kivy.uix.modalview import ModalView
from kivy.app import App from kivy.app import App
from kivy.factory import Factory from kivy.factory import Factory
from kivy.uix.video import Video from kivy.uix.video import Video
from .baseWidget import *
from .toolbar import *
from .dg import DataGrid
from .utils import * 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 .newvideo import Video
from .bgcolorbehavior import BGColorBehavior
from .orientationlayout import OrientationLayout from .orientationlayout import OrientationLayout
from .threadcall import HttpClient from .threadcall import HttpClient
from .register import * from .register import *

View File

@ -109,23 +109,12 @@ class BoxViewer(VBox):
if dir == 'up': if dir == 'up':
recs.reverse() recs.reverse()
idx = -1 idx = -1
recs1 = recs[:self.show_rows] with self.fboContext():
recs2 = recs[self.show_rows:] for r in recs:
self._fbo = Fbo(size=self.size) self.showObject(widgets, r, index=idx)
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)
data['widgets'] = widgets data['widgets'] = widgets
data['idx'] = idx 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): def add_page_delay(self, data, *args):
recs = data['data'] recs = data['data']
@ -182,11 +171,7 @@ class BoxViewer(VBox):
def showObject(self, holders, rec,index=0): def showObject(self, holders, rec,index=0):
opts = { opts = {
"size_hint":[None,None], "csscls":self.viewer_css
"height":self.box_height,
"width":self.box_width,
"color_level":self.color_level,
"radius":self.radius
} }
desc = { desc = {
"widgettype":"PressableBox", "widgettype":"PressableBox",

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,6 @@ from kivy.app import App
from kivy.factory import Factory from kivy.factory import Factory
from appPublic.dictObject import DictObject from appPublic.dictObject import DictObject
from appPublic.timecost import TimeCost
from appPublic.uniqueID import getID from appPublic.uniqueID import getID
from appPublic.myTE import string_template_render from appPublic.myTE import string_template_render

View File

@ -317,6 +317,7 @@ class Form(WidgetCSS, WidgetReady, BoxLayout):
desc['tool_orient'] = 'veritcal' desc['tool_orient'] = 'veritcal'
self.toolbar_w = Factory.Toolbar(**desc) self.toolbar_w = Factory.Toolbar(**desc)
print('box_width=', self.input_width)
self.fsc = VResponsiveLayout( self.fsc = VResponsiveLayout(
box_width = self.input_width, box_width = self.input_width,
size_hint=(1,1) size_hint=(1,1)

View File

@ -14,6 +14,8 @@ from .clickable import SingleCheckBox
from .baseWidget import Text from .baseWidget import Text
from .utils import CSize from .utils import CSize
from appPublic.registerfunction import getRegisterFunctionByName
class TreeViewComplexNode(BoxLayout, TreeViewLabel): class TreeViewComplexNode(BoxLayout, TreeViewLabel):
otext = StringProperty(None) otext = StringProperty(None)
checkbox = BooleanProperty(False) checkbox = BooleanProperty(False)

View File

@ -26,31 +26,44 @@ class VResponsiveLayout(WidgetCSS, WidgetReady, ScrollView):
super(VResponsiveLayout,self).add_widget(self._inner) super(VResponsiveLayout,self).add_widget(self._inner)
self._inner.bind( self._inner.bind(
minimum_height=self._inner.setter('height')) minimum_height=self._inner.setter('height'))
self.setCols() self.bind(pos=self.set_col_width_cnt,size=self.set_col_width_cnt)
self.bind(pos=self.setCols,size=self.setCols)
def on_box_width_c(self, *args): 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: if self.box_width:
return return
if not self._inner:
return
self.col_width = CSize(self.box_width) self.col_width = CSize(self.box_width)
self.col_width_hint = False self.col_width_hint = False
self.set_cols() self.set_col_width_cnt()
def on_box_width(self, *args): def on_box_width(self, *args):
print('on_box_width fire......')
if not self._inner: if not self._inner:
return return
if self.box_width is None:
return
if self.box_width <= 1: if self.box_width <= 1:
self.col_width = self.box_width self.col_width = self.box_width
self.col_width_hint = self.box_width self.col_width_hint = True
else: else:
self.col_width = self.box_width self.col_width = self.box_width
self.col_width_hint = False self.col_width_hint = False
self.set_cols() self.set_col_width_cnt()
def calculate_col_width(self): def calculate_col_width(self):
# cnt * col_width + 2*padding + (cnt-1) * spacing = width # cnt * col_width + 2*padding + (cnt-1) * spacing = width
w = self._inner 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 return width * self.col_width
def get_col_width(self): def get_col_width(self):
@ -59,9 +72,31 @@ class VResponsiveLayout(WidgetCSS, WidgetReady, ScrollView):
def get_cols(self): def get_cols(self):
return self._inner.cols 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: if self.col_width_hint:
self._inner.col_default_width = self.calc_col_width() self._inner.col_default_width = \
self.calculate_col_width()
else: else:
self._inner.col_default_width = self.col_width self._inner.col_default_width = self.col_width
self.setCols() self.setCols()
@ -70,7 +105,7 @@ class VResponsiveLayout(WidgetCSS, WidgetReady, ScrollView):
w.width = self._inner.col_default_width w.width = self._inner.col_default_width
def on_orientation(self,o): def on_orientation(self,o):
self.setCols() self.set_col_width_cnt()
def add_widget(self,widget,**kw): def add_widget(self,widget,**kw):
a = self._inner.add_widget(widget,**kw) a = self._inner.add_widget(widget,**kw)