Advertisement
Guest User

main.kv

a guest
Feb 19th, 2023
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 19.95 KB | None | 0 0
  1. # some button definitions
  2. <IconButton@MDIconButton>:
  3.     theme_icon_color: "Custom"
  4.     icon_color: app.colors[4]
  5.     icon_size: "35sp"
  6.     size_hint: 0.25,None
  7. <TButton@MDFlatButton>:
  8.     font_size: "35sp"
  9.     size_hint: 0.15,0.15
  10.     font_name: "DejaVu"
  11.     theme_text_color: "Custom"
  12.     text_color: app.colors[3]
  13. <FButton@TButton>:
  14.     theme_text_color: "Custom"
  15.     text_color: app.colors[4]
  16.     font_size: "25sp"
  17. <OpButton@TButton>:
  18.     theme_text_color: "Custom"
  19.     text_color: app.theme_cls.primary_color
  20. <T2Button@MDTextButton>:
  21.     markup: True
  22.     font_size: "45dp"
  23.     font_style: "Caption"
  24.  
  25. # main screen
  26. MDScreen:
  27.     md_bg_color: app.colors[2]
  28. # This down here holds the top pannel
  29.     MDBoxLayout:
  30.         id: my_toolbar
  31.         orientation: "horizontal"
  32.         pos_hint: {"top":1}
  33.         size_hint: 1,0.05
  34.        
  35.         # filler
  36.         IconButton:
  37.             opacity: 0
  38.             disabled:True
  39.         # calculator button
  40.         IconButton:
  41.             id: main_btn
  42.             icon: "calculator-variant-outline"
  43.             icon_color: app.theme_cls.primary_color
  44.             on_release: app.change_screen("main_scr")
  45.         # converter button
  46.         IconButton:
  47.             id: conv_btn
  48.             icon: "arrow-decision"
  49.             on_release: app.change_screen("converter_scr")
  50.         # currency button
  51.         IconButton:
  52.             id: curr_btn
  53.             icon: "bank"
  54.             on_release: app.change_screen("currency_scr")
  55.         # settings button
  56.         IconButton:
  57.             id: menu_caller
  58.             icon: "dots-vertical"
  59.             on_release: app.exit_menu.open()
  60.             opacity: 1 if root.ids.manager.current in ["main_scr","about_scr"] else 0
  61.             disabled: False if root.ids.manager.current in ["main_scr","about_scr"] else True
  62.             icon_width: self.icon_width if root.ids.manager.current=="main_scr" else "0sp"
  63.  
  64.     # calculator screen
  65.     MDScreenManager:
  66.         id: manager
  67.  
  68.         MDScreen:
  69.             name: "main_scr"
  70.             # using a label instead of a real TextField
  71.             # this is because of the use of `eval()`
  72.             MDLabel:
  73.                 id: the_input
  74.                 text: "0"
  75.                 halign: "right"
  76.                 font_name: "DejaVu"
  77.                 font_size: "50sp"
  78.                 size_hint: 1,None
  79.                 pos_hint: {"center_x":.44,"center_y":0.61}
  80.             # the line below the input
  81.             MDSeparator:
  82.                 pos_hint: {"center_x":.5,"center_y":.58}
  83.                 color: app.colors[5]
  84.                 size_hint: .85,None
  85.                 height: "1dp"
  86.             RelativeLayout:
  87.                 id: main_calc_btns
  88.                 size_hint: .95,.55
  89.                 pos_hint: {"center_y":0.3}
  90.                 OpButton:
  91.                     text: "C"
  92.                     pos_hint:{"center_x":.15,"center_y":.9}
  93.                     on_release: app.clear_input()
  94.                 MDIconButton:
  95.                     icon: "backspace-outline"
  96.                     theme_icon_color: "Custom"
  97.                     icon_color: app.theme_cls.primary_color
  98.                     icon_size: "35sp"
  99.                     pos_hint:{"center_x":.4,"center_y":.9}
  100.                     on_release: app.backspace()
  101.                 OpButton:
  102.                     text: "%"
  103.                     pos_hint:{"center_x":.65,"center_y":.9}
  104.                     on_release: app.insert_value("%")
  105.                 OpButton:
  106.                     text: "÷"
  107.                     pos_hint:{"center_x":.9,"center_y":.9}
  108.                     on_release: app.insert_value("/")
  109.                 TButton:
  110.                     text: "7"
  111.                     pos_hint:{"center_x":.15,"center_y":.7}
  112.                     on_release: app.insert_value("7")
  113.                 TButton:
  114.                     text: "8"
  115.                     pos_hint:{"center_x":.4,"center_y":.7}
  116.                     on_release: app.insert_value("8")
  117.                 TButton:
  118.                     text: "9"
  119.                     pos_hint:{"center_x":.65,"center_y":.7}
  120.                     on_release: app.insert_value("9")
  121.                 OpButton:
  122.                     text: "×"
  123.                     pos_hint:{"center_x":.9,"center_y":.7}
  124.                     on_release: app.insert_value("*")
  125.                 TButton:
  126.                     text: "4"
  127.                     pos_hint:{"center_x":.15,"center_y":.5}
  128.                     on_release: app.insert_value("4")
  129.                 TButton:
  130.                     text: "5"
  131.                     pos_hint:{"center_x":.4,"center_y":.5}
  132.                     on_release: app.insert_value("5")
  133.                 TButton:
  134.                     text: "6"
  135.                     pos_hint:{"center_x":.65,"center_y":.5}
  136.                     on_release: app.insert_value("6")
  137.                 OpButton:
  138.                     text: "-"
  139.                     pos_hint:{"center_x":.9,"center_y":.5}
  140.                     on_release: app.insert_value("-")
  141.                 TButton:
  142.                     text: "1"
  143.                     pos_hint:{"center_x":.15,"center_y":.3}
  144.                     on_release: app.insert_value("1")
  145.                 TButton:
  146.                     text: "2"
  147.                     pos_hint:{"center_x":.4,"center_y":.3}
  148.                     on_release: app.insert_value("2")
  149.                 TButton:
  150.                     text: "3"
  151.                     pos_hint:{"center_x":.65,"center_y":.3}
  152.                     on_release: app.insert_value("3")
  153.                 OpButton:
  154.                     text: "+"
  155.                     pos_hint:{"center_x":.9,"center_y":.3}
  156.                     on_release: app.insert_value("+")
  157.                 # this boy will be used to change the layout of calculator
  158.                 MDIconButton:
  159.                     icon: "phone-rotate-landscape"
  160.                     icon_size: "35sp"
  161.                     theme_icon_color: "Custom"
  162.                     icon_color: app.theme_cls.primary_color
  163.                     pos_hint:{"center_x":.15,"center_y":.1}
  164.                     #on_release: app.switch_lays()
  165.                 TButton:
  166.                     text: "0"
  167.                     pos_hint:{"center_x":.4,"center_y":.1}
  168.                     on_release: app.insert_value("0")
  169.                 TButton:
  170.                     text: "."
  171.                     pos_hint:{"center_x":.65,"center_y":.1}
  172.                     on_release: app.insert_value(".")
  173.                 MDFillRoundFlatButton:
  174.                     text: "="
  175.                     pos_hint: {"center_x":.9,"center_y":.1}
  176.                     font_size: "35sp"
  177.                     on_release: app.evaluate()
  178.             # avanced buttons layout
  179.             RelativeLayout:
  180.                 id: second_calc_btns
  181.                 size_hint: .95,.55
  182.                 disabled: True
  183.                 opacity: 0
  184.                 pos_hint: {"center_y":0.3}
  185.                 FButton:
  186.                     text: "2nd"
  187.                     pos_hint:{"center_x":.1,"center_y":.9}
  188.                     #on_release: app.insert_value("7",1)
  189.                 FButton:
  190.                     text: "deg"
  191.                     pos_hint:{"center_x":.3,"center_y":.9}
  192.                     #on_release: app.insert_value("7",1)
  193.                 FButton:
  194.                     text: "sin"
  195.                     pos_hint:{"center_x":.5,"center_y":.9}
  196.                     on_release: app.insert_value("sin(")
  197.                 FButton:
  198.                     text: "cos"
  199.                     pos_hint:{"center_x":.7,"center_y":.9}
  200.                     on_release: app.insert_value("cos(")
  201.                 FButton:
  202.                     text: "tan"
  203.                     pos_hint:{"center_x":.9,"center_y":.9}
  204.                     on_release: app.insert_value("tan(")
  205.                 FButton:
  206.                     text: "xⁿ"
  207.                     pos_hint:{"center_x":.1,"center_y":.76}
  208.                     on_release: app.insert_value("^")
  209.                 FButton:
  210.                     text: "lg"
  211.                     pos_hint:{"center_x":.3,"center_y":.76}
  212.                     on_release: app.insert_value("lg(")
  213.                 FButton:
  214.                     text: "ln"
  215.                     pos_hint:{"center_x":.5,"center_y":.76}
  216.                     on_release: app.insert_value("ln(")
  217.                 FButton:
  218.                     text: "("
  219.                     pos_hint:{"center_x":.7,"center_y":.76}
  220.                     on_release: app.insert_value("(")
  221.                 FButton:
  222.                     text: ")"
  223.                     pos_hint:{"center_x":.9,"center_y":.76}
  224.                     on_release: app.insert_value(")")
  225.                 FButton:
  226.                     text: "√"
  227.                     pos_hint:{"center_x":.1,"center_y":.62}
  228.                     on_release: app.insert_value("sqrt(")
  229.                 OpButton:
  230.                     text: "C"
  231.                     pos_hint:{"center_x":.3,"center_y":.62}
  232.                     on_release: app.clear_input()
  233.                 MDIconButton:
  234.                     icon: "backspace-outline"
  235.                     theme_icon_color: "Custom"
  236.                     icon_color: app.theme_cls.primary_color
  237.                     icon_size: "35sp"
  238.                     pos_hint:{"center_x":.5,"center_y":.62}
  239.                     on_release: app.backspace()
  240.                 OpButton:
  241.                     text: "%"
  242.                     pos_hint:{"center_x":.7,"center_y":.62}
  243.                     on_release: app.insert_value("%")
  244.                 OpButton:
  245.                     text: "÷"
  246.                     pos_hint:{"center_x":.9,"center_y":.62}
  247.                     on_release: app.insert_value("/")
  248.                 FButton:
  249.                     text: "x!"
  250.                     pos_hint:{"center_x":.1,"center_y":.48}
  251.                     on_release: app.insert_value("fact(")
  252.                 TButton:
  253.                     text: "7"
  254.                     pos_hint:{"center_x":.3,"center_y":.48}
  255.                     on_release: app.insert_value("7")
  256.                 TButton:
  257.                     text: "8"
  258.                     pos_hint:{"center_x":.5,"center_y":.48}
  259.                     on_release: app.insert_value("8")
  260.                 TButton:
  261.                     text: "9"
  262.                     pos_hint:{"center_x":.7,"center_y":.48}
  263.                     on_release: app.insert_value("9")
  264.                 OpButton:
  265.                     text: "×"
  266.                     pos_hint:{"center_x":.9,"center_y":.48}
  267.                     on_release: app.insert_value("*")
  268.                 FButton:
  269.                     text: "in"
  270.                     pos_hint:{"center_x":.1,"center_y":.34}
  271.                     on_release: app.insert_value("^(-1)")
  272.                 TButton:
  273.                     text: "4"
  274.                     pos_hint:{"center_x":.3,"center_y":.34}
  275.                     on_release: app.insert_value("4")
  276.                 TButton:
  277.                     text: "5"
  278.                     pos_hint:{"center_x":.5,"center_y":.34}
  279.                     on_release: app.insert_value("5")
  280.                 TButton:
  281.                     text: "6"
  282.                     pos_hint:{"center_x":.7,"center_y":.34}
  283.                     on_release: app.insert_value("6")
  284.                 OpButton:
  285.                     text: "-"
  286.                     pos_hint:{"center_x":.9,"center_y":.34}
  287.                     on_release: app.insert_value("-")
  288.                 FButton:
  289.                     text: "π"
  290.                     pos_hint:{"center_x":.1,"center_y":.2}
  291.                     on_release: app.insert_value("pi")
  292.                 TButton:
  293.                     text: "1"
  294.                     pos_hint:{"center_x":.3,"center_y":.2}
  295.                     on_release: app.insert_value("1")
  296.                 TButton:
  297.                     text: "2"
  298.                     pos_hint:{"center_x":.5,"center_y":.2}
  299.                     on_release: app.insert_value("2")
  300.                 TButton:
  301.                     text: "3"
  302.                     pos_hint:{"center_x":.7,"center_y":.2}
  303.                     on_release: app.insert_value("3")
  304.                 OpButton:
  305.                     text: "+"
  306.                     pos_hint:{"center_x":.9,"center_y":.2}
  307.                     on_release: app.insert_value("+")
  308.                 MDIconButton:
  309.                     icon: "phone-rotate-landscape"
  310.                     icon_size: "35sp"
  311.                     theme_icon_color: "Custom"
  312.                     icon_color: app.theme_cls.primary_color
  313.                     pos_hint:{"center_x":.1,"center_y":.06}
  314.                     #on_release: app.switch_lays()
  315.                 TButton:
  316.                     text: "e"
  317.                     pos_hint:{"center_x":.3,"center_y":.06}
  318.                     on_release: app.insert_value("e")
  319.                 TButton:
  320.                     text: "0"
  321.                     pos_hint:{"center_x":.5,"center_y":.06}
  322.                     on_release: app.insert_value("0")
  323.                 TButton:
  324.                     text: "."
  325.                     pos_hint:{"center_x":.7,"center_y":.06}
  326.                     on_release: app.insert_value(".")
  327.                 MDFillRoundFlatButton:
  328.                     text: "="
  329.                     pos_hint: {"center_x":.9,"center_y":.06}
  330.                     font_size: "35sp"
  331.                     on_release: app.evaluate()
  332.     # converter screen
  333.         MDScreen:
  334.             name: "converter_scr"
  335.         # i thinked of using pos_hint for these custom buttons
  336.             FloatLayout:
  337.                 IconButton:
  338.                     pos_hint: {"center_x":.18,"center_y":.88}
  339.                     markup:True
  340.                     icon_size: "40sp"
  341.                     icon: "cake-variant-outline"
  342.                 T2Button:
  343.                     pos_hint: {"center_x":.18,"center_y":.83}
  344.                     text: "[color=bcbcbc][b]Mosha"
  345.                    
  346.                 IconButton:
  347.                     pos_hint: {"center_x":.5,"center_y":.88}
  348.                     markup:True
  349.                     icon_size: "40sp"
  350.                     icon: "diameter-outline"
  351.                     on_release: app.change_screen1("surface")
  352.                 T2Button:
  353.                     pos_hint: {"center_x":.5,"center_y":.83}
  354.                     text: "[color=bcbcbc][b]Sipërfaqja"
  355.                
  356.                 IconButton:
  357.                     pos_hint: {"center_x":.82,"center_y":.88}
  358.                     markup:True
  359.                     icon_size: "40sp"
  360.                     icon: "scale-bathroom"
  361.                 T2Button:
  362.                     pos_hint: {"center_x":.82,"center_y":.83}
  363.                     text: "[color=bcbcbc][b]BMI"
  364.                
  365.                 IconButton:
  366.                     pos_hint: {"center_x":.18,"center_y":.71}
  367.                     markup:True
  368.                     icon_size: "40sp"
  369.                     icon: "orbit-variant"
  370.                     on_release: app.change_screen1("data_binary")
  371.                 T2Button:
  372.                     pos_hint: {"center_x":.18,"center_y":.66}
  373.                     text: "[color=bcbcbc][b]Të dhëna"
  374.                    
  375.                 IconButton:
  376.                     pos_hint: {"center_x":.5,"center_y":.71}
  377.                     markup:True
  378.                     icon_size: "40sp"
  379.                     icon: "calendar-multiselect"
  380.                 T2Button:
  381.                     pos_hint: {"center_x":.5,"center_y":.66}
  382.                     text: "[color=bcbcbc][b]Data"
  383.                
  384.                 IconButton:
  385.                     pos_hint: {"center_x":.82,"center_y":.71}
  386.                     markup:True
  387.                     icon_size: "40sp"
  388.                     icon: "tag-outline"
  389.                 T2Button:
  390.                     pos_hint: {"center_x":.82,"center_y":.66}
  391.                     text: "[color=bcbcbc][b]Zbritje"
  392.                
  393.                 IconButton:
  394.                     pos_hint: {"center_x":.18,"center_y":.54}
  395.                     markup:True
  396.                     icon_size: "40sp"
  397.                     icon: "ruler"
  398.                     on_release: app.change_screen1("length")
  399.                 T2Button:
  400.                     pos_hint: {"center_x":.18,"center_y":.49}
  401.                     text: "[color=bcbcbc][b]Gjatësia"
  402.                    
  403.                 IconButton:
  404.                     pos_hint: {"center_x":.5,"center_y":.54}
  405.                     markup:True
  406.                     icon_size: "40sp"
  407.                     icon: "weight"
  408.                     on_release: app.change_screen1("weight")
  409.                 T2Button:
  410.                     pos_hint: {"center_x":.5,"center_y":.49}
  411.                     text: "[color=bcbcbc][b]Masa"
  412.                
  413.                 IconButton:
  414.                     pos_hint: {"center_x":.82,"center_y":.54}
  415.                     markup:True
  416.                     icon_size: "40sp"
  417.                     icon: "hexadecimal"
  418.                     on_release: app.change_screen1("bases")
  419.                 T2Button:
  420.                     pos_hint: {"center_x":.82,"center_y":.49}
  421.                     text: "[color=bcbcbc][b]Sistemi\nNumerik"
  422.                
  423.                 IconButton:
  424.                     pos_hint: {"center_x":.18,"center_y":.37}
  425.                     markup:True
  426.                     icon_size: "40sp"
  427.                     icon: "speedometer"
  428.                     on_release: app.change_screen1("speed")
  429.                 T2Button:
  430.                     pos_hint: {"center_x":.18,"center_y":.32}
  431.                     text: "[color=bcbcbc][b]Shpejtësia"
  432.                    
  433.                 IconButton:
  434.                     pos_hint: {"center_x":.5,"center_y":.37}
  435.                     markup:True
  436.                     icon_size: "40sp"
  437.                     icon: "thermometer"
  438.                 T2Button:
  439.                     pos_hint: {"center_x":.5,"center_y":.32}
  440.                     text: "[color=bcbcbc][b]Temperatura"
  441.                
  442.                 IconButton:
  443.                     pos_hint: {"center_x":.82,"center_y":.37}
  444.                     markup:True
  445.                     icon_size: "40sp"
  446.                     icon: "clock-outline"
  447.                     on_release: app.change_screen1("time")
  448.                 T2Button:
  449.                     pos_hint: {"center_x":.82,"center_y":.32}
  450.                     text: "[color=bcbcbc][b]Koha"
  451.                
  452.                 IconButton:
  453.                     pos_hint: {"center_x":.18,"center_y":.20}
  454.                     markup:True
  455.                     icon_size: "40sp"
  456.                     icon: "cube-outline"
  457.                     on_release: app.change_screen1("volume")
  458.                 T2Button:
  459.                     pos_hint: {"center_x":.18,"center_y":.15}
  460.                     text: "[color=bcbcbc][b]Volumi"
  461.    
  462.     # currency screen
  463.         MDScreen:
  464.             name: "currency_scr"
  465.             FloatLayout:
  466.                 IconButton:
  467.                     pos_hint: {"center_x":.18,"center_y":.88}
  468.                     markup:True
  469.                     icon_size: "40sp"
  470.                     icon: "cash"
  471.                 T2Button:
  472.                     pos_hint: {"center_x":.18,"center_y":.83}
  473.                     text: "[color=bcbcbc][b]Monedha"
  474.                    
  475.                 IconButton:
  476.                     pos_hint: {"center_x":.5,"center_y":.88}
  477.                     markup:True
  478.                     icon_size: "40sp"
  479.                     icon: "elevation-rise"
  480.                 T2Button:
  481.                     pos_hint: {"center_x":.5,"center_y":.83}
  482.                     text: "[color=bcbcbc][b]Investimi"
  483.                
  484.                 IconButton:
  485.                     pos_hint: {"center_x":.82,"center_y":.88}
  486.                     markup:True
  487.                     icon_size: "40sp"
  488.                     icon: "credit-card"
  489.                 T2Button:
  490.                     pos_hint: {"center_x":.82,"center_y":.83}
  491.                     text: "[color=bcbcbc][b]Kredi"
  492.                    
  493.     # settings screen
  494.         MDScreen:
  495.             name: "settings_scr"
  496.         # why not making it standart ?
  497.             MDTopAppBar:
  498.                 title: "Cilësimet"
  499.                 pos_hint: {"top":1}
  500.                 md_bg_color: app.theme_cls.bg_darkest
  501.                 left_action_items:[["arrow-left",lambda x: app.change_screen("main_scr")]]
  502.    
  503.     # about screen
  504.         MDScreen:
  505.             name: "about_scr"
  506.             MDIconButton:
  507.                 icon: "arrow-left"
  508.                 icon_size: "35sp"
  509.                 pos_hint: {"center_x":.05,"top":1}
  510.                 on_release:
  511.                     app.root.ids.my_toolbar.opacity = 0
  512.                     app.root.ids.my_toolbar.disabled = True
  513.                     app.change_screen("main_scr")
  514.             MDLabel:
  515.                 text: "Rreth"
  516.                 halign: "center"
  517.        
  518.         # converter screen (pure conversions)
  519.         MDScreen:
  520.             name: "convy"
  521.             MDBoxLayout:
  522.                 pos_hint: {"center_x":.5,"center_y":.95}
  523.                 size_hint: .9,.4
  524.                 orientation: "vertical"
  525.                 spacing: "50sp"
  526.                 MDBoxLayout:
  527.                     orientation: "horizontal"
  528.                     size_hint: .95,None
  529.                     TButton:
  530.                         id: first
  531.                         text: ""
  532.                         font_size: "25sp"
  533.                         on_release: app.first_menu.open()
  534.                     MDLabel:
  535.                         id: input_label
  536.                         text: "0"
  537.                         halign: "right"
  538.                         font_size: "25sp"
  539.                 MDBoxLayout:
  540.                     orientation: "horizontal"
  541.                     size_hint: .95,None
  542.                     TButton:
  543.                         id: second
  544.                         text: ""
  545.                         font_size: "25sp"
  546.                         on_release: app.second_menu.open()
  547.                     MDLabel:
  548.                         id: output_label
  549.                         text: "0"
  550.                         halign: "right"
  551.                         font_size: "25sp"
  552.             MDSeparator:
  553.                 pos_hint: {"center_x":.5,"center_y":.6}
  554.                 color: app.colors[5]
  555.                 size_hint: .85,None
  556.                 height: "1dp"
  557.             RelativeLayout:
  558.                 size_hint: .85,.55
  559.                 pos_hint: {"center_y":.31}
  560.                 TButton:
  561.                     text: "7"
  562.                     pos_hint: {"center_x":.2,"center_y":.85}
  563.                     on_release: app.insert_value("7")
  564.                 TButton:
  565.                     text: "8"
  566.                     pos_hint: {"center_x":.45,"center_y":.85}
  567.                     on_release: app.insert_value("8")
  568.                 TButton:
  569.                     text: "9"
  570.                     pos_hint: {"center_x":.7,"center_y":.85}
  571.                     on_release: app.insert_value("9")
  572.                 TButton:
  573.                     text: "4"
  574.                     pos_hint: {"center_x":.2,"center_y":.6}
  575.                     on_release: app.insert_value("4")
  576.                 TButton:
  577.                     text: "5"
  578.                     pos_hint: {"center_x":.45,"center_y":.6}
  579.                     on_release: app.insert_value("5")
  580.                 TButton:
  581.                     text: "6"
  582.                     pos_hint: {"center_x":.7,"center_y":.6}
  583.                     on_release: app.insert_value("6")
  584.                 TButton:
  585.                     text: "1"
  586.                     pos_hint: {"center_x":.2,"center_y":.35}
  587.                     on_release: app.insert_value("1")
  588.                 TButton:
  589.                     text: "2"
  590.                     pos_hint: {"center_x":.45,"center_y":.35}
  591.                     on_release: app.insert_value("2")
  592.                 TButton:
  593.                     text: "3"
  594.                     pos_hint: {"center_x":.7,"center_y":.35}
  595.                     on_release: app.insert_value("3")
  596.                 TButton:
  597.                     text: "0"
  598.                     pos_hint: {"center_x":.45,"center_y":.1}
  599.                     on_release: app.insert_value("0")
  600.                 TButton:
  601.                     text: "."
  602.                     pos_hint: {"center_x":.7,"center_y":.1}
  603.                     on_release: app.insert_value(".")
  604.                 TButton:
  605.                     text: "AC"
  606.                     theme_text_color: "Custom"
  607.                     text_color: app.theme_cls.primary_color
  608.                     pos_hint: {"center_x":.95,"center_y":.73}
  609.                     on_release: app.clear_input()
  610.                 MDIconButton:
  611.                     icon: "backspace-outline"
  612.                     icon_size: "40sp"
  613.                     ripple_scale: 0
  614.                     theme_icon_color: "Custom"
  615.                     icon_color: app.theme_cls.primary_color
  616.                     pos_hint: {"center_x":.95,"center_y":.48}
  617.                     on_release: app.backspace()
  618.                 MDIconButton:
  619.                     icon: "arrow-left-bottom"
  620.                     icon_size: "40sp"
  621.                     ripple_scale: 0
  622.                     theme_icon_color: "Custom"
  623.                     icon_color: app.theme_cls.primary_color
  624.                     pos_hint: {"center_x":.95,"center_y":.23}
  625.                     on_release: app.convert()
  626.        
  627.         # base converter
  628.         MDScreen:
  629.             name: "bases-convy"
  630.             MDBoxLayout:
  631.                 pos_hint: {"center_x":.5,"center_y":.95}
  632.                 size_hint: .9,.4
  633.                 orientation: "vertical"
  634.                 spacing: "50sp"
  635.                 MDBoxLayout:
  636.                     orientation: "horizontal"
  637.                     size_hint: .95,None
  638.                     TButton:
  639.                         id: bases_first
  640.                         text: ""
  641.                         font_size: "25sp"
  642.                         on_release: app.bases_first_menu.open()
  643.                     MDLabel:
  644.                         id: bases_input_label
  645.                         text: "0"
  646.                         halign: "right"
  647.                         font_size: "25sp"
  648.                 MDBoxLayout:
  649.                     orientation: "horizontal"
  650.                     size_hint: .95,None
  651.                     TButton:
  652.                         id: bases_second
  653.                         text: ""
  654.                         font_size: "25sp"
  655.                         on_release: app.bases_second_menu.open()
  656.                     MDLabel:
  657.                         id: bases_output_label
  658.                         text: "0"
  659.                         halign: "right"
  660.                         font_size: "25sp"
  661.             MDSeparator:
  662.                 pos_hint: {"center_x":.5,"center_y":.6}
  663.                 color: app.colors[5]
  664.                 size_hint: .85,None
  665.                 height: "1dp"
  666.             RelativeLayout:
  667.                 size_hint: .95,.55
  668.                 pos_hint: {"center_y":.3}
  669.                 TButton:
  670.                     text: "7"
  671.                     pos_hint: {"center_x":.15,"center_y":.7}
  672.                     on_release: app.insert_value("7")
  673.                 TButton:
  674.                     text: "8"
  675.                     pos_hint: {"center_x":.4,"center_y":.7}
  676.                     on_release: app.insert_value("8")
  677.                 TButton:
  678.                     text: "9"
  679.                     pos_hint: {"center_x":.65,"center_y":.7}
  680.                     on_release: app.insert_value("9")
  681.                 TButton:
  682.                     text: "4"
  683.                     pos_hint: {"center_x":.15,"center_y":.5}
  684.                     on_release: app.insert_value("4")
  685.                 TButton:
  686.                     text: "5"
  687.                     pos_hint: {"center_x":.4,"center_y":.5}
  688.                     on_release: app.insert_value("5")
  689.                 TButton:
  690.                     text: "6"
  691.                     pos_hint: {"center_x":.65,"center_y":.5}
  692.                     on_release: app.insert_value("6")
  693.                 TButton:
  694.                     text: "1"
  695.                     pos_hint: {"center_x":.15,"center_y":.3}
  696.                     on_release: app.insert_value("1")
  697.                 TButton:
  698.                     text: "2"
  699.                     pos_hint: {"center_x":.4,"center_y":.3}
  700.                     on_release: app.insert_value("2")
  701.                 TButton:
  702.                     text: "3"
  703.                     pos_hint: {"center_x":.65,"center_y":.3}
  704.                     on_release: app.insert_value("3")
  705.                 TButton:
  706.                     text: "0"
  707.                     pos_hint: {"center_x":.4,"center_y":.1}
  708.                     on_release: app.insert_value("0")
  709.                 TButton:
  710.                     text: "AC"
  711.                     theme_text_color: "Custom"
  712.                     text_color: app.theme_cls.primary_color
  713.                     pos_hint: {"center_x":.15,"center_y":.9}
  714.                     on_release: app.clear_input()
  715.                 MDIconButton:
  716.                     icon: "backspace-outline"
  717.                     icon_size: "40sp"
  718.                     ripple_scale: 0
  719.                     theme_icon_color: "Custom"
  720.                     icon_color: app.theme_cls.primary_color
  721.                     pos_hint: {"center_x":.4,"center_y":.9}
  722.                     on_release: app.backspace()
  723.                 MDIconButton:
  724.                     icon: "arrow-left-bottom"
  725.                     icon_size: "40sp"
  726.                     ripple_scale: 0
  727.                     theme_icon_color: "Custom"
  728.                     icon_color: app.theme_cls.primary_color
  729.                     pos_hint: {"center_x":.65,"center_y":.9}
  730.                     on_release: app.conv_bases()
  731.                 TButton:
  732.                     text: "A"
  733.                     pos_hint: {"center_x":.65,"center_y":.1}
  734.                     on_release: app.insert_value("A")
  735.                 TButton:
  736.                     text: "B"
  737.                     pos_hint: {"center_x":.9,"center_y":.1}
  738.                     on_release: app.insert_value("B")
  739.                 TButton:
  740.                     text: "C"
  741.                     pos_hint: {"center_x":.9,"center_y":.3}
  742.                     on_release: app.insert_value("C")
  743.                 TButton:
  744.                     text: "D"
  745.                     pos_hint: {"center_x":.9,"center_y":.5}
  746.                     on_release: app.insert_value("D")
  747.                 TButton:
  748.                     text: "E"
  749.                     pos_hint: {"center_x":.9,"center_y":.7}
  750.                     on_release: app.insert_value("E")
  751.                 TButton:
  752.                     text: "F"
  753.                     pos_hint: {"center_x":.9,"center_y":.9}
  754.                     on_release: app.insert_value("F")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement