oof annoying how diff mac and linux render this

pull/20/head
quadrismegistus 4 years ago
parent fa91a1c536
commit 82c51842de

@ -11,7 +11,7 @@ ASPECT_RATIO = PLAYING_CARDS[0]/PLAYING_CARDS[1]
HEIGHT = 800
if platform.platform().startswith('Linux'):
HEIGHT *= 1.5
HEIGHT *= 2
WINDOW_SIZE=int(HEIGHT * ASPECT_RATIO),int(HEIGHT)

@ -53,8 +53,9 @@ from p2p import p2p,crypto,api
from kivy.event import EventDispatcher
import threading,asyncio,sys
# raise Exception(str(Window.size))
Window.size = WINDOW_SIZE
# Window.fullscreen = True #'auto'
# with open('log.txt','w') as of:
# of.write('### LOG ###\n')

@ -162,7 +162,6 @@
orientation: "vertical"
padding: "20dp"
size_hint: (None, None)
width: '400sp'
# size:('400sp','800sp')
# adaptive_height: True
pos_hint: {"center_x": .5, "center_y": .5}

@ -12,6 +12,7 @@ from kivy.app import App
from threading import Thread
import asyncio
from misc import *
from kivy.core.window import Window
@ -74,6 +75,14 @@ class PostCard(MDCard):
self.content = data.get('content','')
self.timestamp = data.get('timestamp',None)
self.bind(minimum_height=self.setter('height'))
minwidth = 400
maxwidth = 800
abouts = int(Window.size[0]/1.5)
if abouts < minwidth: self.width=f'{minwidth}sp'
if abouts > maxwidth: self.width=f'{maxwidth}sp'
self.width=f'{abouts}sp'
# self.log('PostCard.img_id =',self.img_id)
# self.log('PostCard.img_ext =',self.img_ext)

@ -511,7 +511,7 @@ class Api(object):
async def register(self,name,passkey=None,just_return_keys=False):
# if not (name and passkey): return {'error':'Name and password needed'}
person = await self.get_person(name)
keys = await self.get_keys()
keys = self.get_keys()
if person is not None:
self.log('register() person <-',person)
# try to log in

Loading…
Cancel
Save