omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Killerburns
    3. Posts

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by Killerburns

    • RE: Change Color of selected segmentcontrol

      Thanks @cvp for spending your time to help me out here. Youre brilliant :). There is only one thing that disturbs a bit. You still can see the indicator moving behind the red path and its still white which doesnt look nice on a dark theme. Maybe there is a solution to animate this rectangular shape to the position of the selected index, so that the indicator is always covered?

      I think for now i will build my own segmented control with buttons, labels and a colored custom view with a background color that animates x to the button that has been pressed. Thats a dirty solution but this way i know what i‘am doing :D

      But if you or someone else wants find a perfect and effectiv solution for this, feel free to do so and share it with us :)

      Thanks again for your support
      Best wishes and
      Stay safe

      ///

      Almost the same now :P but dirty solution

      https://imgur.com/Qs8p9ta

      import ui
      
      
      def segment_tapped(sender):
      	x = sender.x
      	
      	if sender.name == "FireTv":
      		v['segmentedCtrl_input']['idx'].width = 56
      		x = x+2
      		
      	elif sender.name == "Musik":
      		v['segmentedCtrl_input']['idx'].width = 57  
      		x = x-1
      				
      	else: 	
      		v['segmentedCtrl_input']['idx'].width = 59
      		
      	animate_movex(v['segmentedCtrl_input']['idx'],x)
      	
      	for a in buttons:
      		if a.name == sender.name:
      			a.font = ('Avenir-Heavy', 13)
      		else:
      			a.font = ('Avenir-Book', 13)
      
      		
      def animate_movex(v, x):
      	def a():
      		v.x = x
      	ui.animate(a, 0.3)
      		
      v = ui.load_view()
      buttons = v['segmentedCtrl_input'].subviews
      
      v['segmentedCtrl_input']['idx'].background_color = '#92b8ff'
      
      for a in buttons:
      	a.font = ('Avenir-Book', 13)
      	
      v.present('sheet') ```
      posted in Editorial
      Killerburns
      Killerburns
    • RE: Change Color of selected segmentcontrol

      Hi cvp,
      Thanks for your reply. I have already seen this thread, and as i mentioned was able to change color of the font as you describe it in the the thread you have posted. If its about the „get back ios 12 appearance“ i really have no idea how to use that :( I‘am really a beginner.

      I thought about to build a own segmented control with buttons and ui animate if this is too complicated to get it work with the build in segmented control.

      posted in Editorial
      Killerburns
      Killerburns
    • Change Color of selected segmentcontrol

      Hey guys,
      I’am quite new to pythonista and i already love it. Everything is well documented and there is a thread for everything you need in this Forum. Except for this special requirement. For my own App í´m trying to figure out how i can set the color of the selected segment.

      During my search i found this topic https://forum.omz-software.com/topic/5672/custom-font-for-ui-segmentedcontrol and i was able to get this to work in my code. But unfortunately its only the font type, color and size. But if we can access theese attributes wouldnt we be able to change the color of the selection as well.?

      I tried with the attribute nsforegroundcolorattributename, but without succes. And i have to admit, I have no experience with object C.

      So has anyone a clue how i can get this to work? I would really appreciate it :)

      Best wishes

      posted in Editorial
      Killerburns
      Killerburns