Forum Archive

Change background color in the dialogs form?

david

Hi,
can it be changed the background color in the dialogs form?

Best regards.

omz

That's currently not supported, sorry. If you really need this, feel free to look at the source code of the dialogs module – it's all just Python…

david

working on it... thank you!

cvp

@david

monkey patch of a module that you are sure it will be called after creation of the tableview of dialog fields (in my poor English)

import ui
import dialogs

def my_tableview_cell_for_row(self, tv, section, row):
    if self.view.background_color != 'blue':
        self.view.background_color = 'blue'
    return self.cells[section][row]

dialogs._FormDialogController.tableview_cell_for_row = my_tableview_cell_for_row

fields = [{'title':'title1','type':'text','value':''}, {'title':'title2','type':'text','value':''}]
f = dialogs.form_dialog(title='dialog title', done_button_title='ok',fields=fields, sections=None)