Adjust the palettes.

@return void
437295
public function adjustPalettes(): void
    {
        // Load custom form config.
        $this->environment->enterContext(FormContext::forForm((int) CURRENT_ID));
        $widgets = $this->environment->getConfig()->get('form.widgets', []);

        foreach ($widgets as $name => $config) {
            if (!empty($config['input_group'])) {
                try {
                    MetaPalettes::appendFields('tl_form_field', $name, 'fconfig', ['bs_addInputGroup']);
                    // @codingStandardsIgnoreStart Catch statement is empty on purpose
                } catch (PaletteNotFoundException | LegacyPaletteNotFoundException $e) {
                    // Palette does not exist. Just skip it.
                }
                // @codingStandardsIgnoreEnd
            }
        }
    }
1251716
def adjustButtons( self ):
        
        y = 1
        
        for btn in self.buttons():
            btn.setIconSize(self.iconSize())
            btn.setFixedSize(QSize(self.height() - 2, self.height() - 2))
        
        # adjust the location for the left buttons
        left_buttons = self._buttons.get(Qt.AlignLeft, [])
        x = (self.cornerRadius() / 2.0) + 2
        
        for btn in left_buttons:
            btn.move(x, y)
            x += btn.width()
        
        # adjust the location for the right buttons
        right_buttons = self._buttons.get(Qt.AlignRight, [])
        
        w       = self.width()
        bwidth  = sum([btn.width() for btn in right_buttons])
        bwidth  += (self.cornerRadius() / 2.0) + 1
        
        for btn in right_buttons:
            btn.move(w - bwidth, y)
            bwidth -= btn.width()
        
        self._buttonWidth = sum([btn.width() for btn in self.buttons()])
        self.adjustTextMargins()
34181
public function initializePalette(): void
    {
        if (Input::get('act') === 'edit') {
            $model = GridModel::findByPk(Input::get('id'));
            $sizes = array_map(
                function ($value) {
                    return $value . 'Size';
                },
                StringUtil::deserialize($model->sizes, true)
            );

            PaletteManipulator::create()
                ->addField($sizes, 'sizes')
                ->applyToPalette('default', 'tl_bs_grid');
        }
    }
375108
public void adjustColumnWidths() {
		if (ADJUST_COLUMN_WIDTHS_MAX_ROWS > 0) {
			TableColumn tableColumn;
			TableCellRenderer renderer;
			Object value;
			Component component;
			final int columnCount = getColumnCount();
			final int rowCount = Math.min(getRowCount(), ADJUST_COLUMN_WIDTHS_MAX_ROWS);
			int columnWidth;
			final int maxWidth = 250; // taille ajustée maximum (15 minimum par défaut)

			// Boucle sur chaque colonne et chaque ligne.
			// Trouve le max de la largeur du header et de chaque cellule
			// et fixe la largeur de la colonne en fonction.
			for (int colNum = 0; colNum < columnCount; colNum++) {
				tableColumn = columnModel.getColumn(colNum);
				if (tableColumn.getMaxWidth() <= 0) {
					continue; // colonne invisible
				}

				renderer = getTableHeader().getDefaultRenderer();
				value = tableColumn.getHeaderValue();
				component = renderer.getTableCellRendererComponent(this, value, false, false, -1,
						colNum);
				columnWidth = component.getPreferredSize().width + 10;
				renderer = getCellRenderer(-1, colNum);

				for (int rowNum = 0; rowNum < rowCount; rowNum++) {
					value = getValueAt(rowNum, colNum);
					component = renderer.getTableCellRendererComponent(this, value, false, false,
							rowNum, colNum);
					columnWidth = Math.max(columnWidth, component.getPreferredSize().width);
				}
				columnWidth = Math.min(maxWidth, columnWidth);

				tableColumn.setPreferredWidth(columnWidth + getIntercellSpacing().width);
			}
		}
	}
309679
public function applyEditSettings()
    {
        $this->applyDetailSettings();
        $this->resetOrder();

        $yesNo = $this->util->getTranslated()->getYesNo();

        // GENERAL TAB
        $this->set('gor_name',
                'size', 25,
                'validator', $this->createUniqueValidator('gor_name')
                );
        $this->set('gor_location',
                'size', 50,
                'maxlength', 255
                );
        $this->set('gor_task',
                'size', 25);
        $this->set('gor_url',
                'size', 50
                );
        $this->setIfExists('gor_url_base',
                'size', 50,
                'filter', 'TrailingSlash'
                );
        $this->setIfExists('gor_code',
                'size', 10
                );
        $this->set('gor_provider_id');
        $this->setIfExists('gor_active',
                'elementClass', 'Checkbox'
                );

        // EMAIL TAB
        $this->set('gor_contact_name', 'tab', $this->_('Email') . ' & ' . $this->_('Token'),
                'order', $this->getOrder('gor_active') + 1000,
                'size', 25
                );
        $this->set('gor_contact_email',
                'size', 50,
                'validator', 'SimpleEmail'
                );
        $this->set('gor_mail_watcher', 'label', $this->_('Check cron job mail'),
                    'description', $this->_('If checked the organization contact will be mailed when the cron job does not run on time.'),
                    'elementClass', 'Checkbox',
                    'multiOptions', $yesNo
                    );
        $this->set('gor_welcome',
                'elementClass', 'Textarea',
                'rows', 5
                );
        $this->set('gor_signature',
                'elementClass', 'Textarea',
                'rows', 5
                );
        $this->set('gor_create_account_template');
        $this->set('gor_reset_pass_template');

        // ACCESS TAB
        $this->set('gor_has_login',  'tab', $this->_('Access'),
                'order', $this->getOrder('gor_reset_pass_template') + 1000,
                'elementClass', 'CheckBox'
                );
        $this->set('gor_add_respondents',
                'elementClass', 'CheckBox'
                );
        $this->set('gor_has_respondents',
                'elementClass', 'Exhibitor'
                );
        $this->set('gor_respondent_group');
        $this->set('gor_accessible_by',
                'elementClass', 'MultiCheckbox'
                );
        $this->set('allowed',
                'label', $this->_('Can access'),
                'elementClass', 'Html'
                );

        $this->setIfExists('gor_allowed_ip_ranges',
            'elementClass', 'Textarea',
            'rows', 4,
            'validator', new \Gems_Validate_IPRanges()
            );
        $this->setIfExists('gor_user_class');

        $definitions = $this->get('gor_user_class', 'multiOptions');
        if ($definitions && (count($definitions) > 1)) {
            reset($definitions);
            // MD: Removed onchange because it does not play nice with the processAfterLoad and save methods in this class
            //     @@TODO: See if we can enable it when these methods are changed into a dependency
            $this->setIfExists('gor_user_class', 'default', key($definitions), 'required', true/*, 'onchange', 'this.form.submit();'*/);
        }

        // INTERFACE TAB
        $this->setIfExists('gor_respondent_edit', 'tab', $this->_('Interface'),
                'default', '',
                'elementClass', 'Radio'
                );
        $this->setIfExists('gor_respondent_show',
                'default', '',
                'elementClass', 'Radio'
                );
        $this->setIfExists('gor_respondent_subscribe',
                'default', '',
                'elementClass', 'Radio'
                );
        $this->setIfExists('gor_respondent_unsubscribe',
                'default', '',
                'elementClass', 'Radio'
                );

        $this->setIfExists('gor_token_ask',
                'default', 'Gems\\Screens\\Token\\Ask\\ProjectDefaultAsk',
                'elementClass', 'Radio'
                );

        $this->setIfExists('gor_resp_change_event',
                'order', $this->getOrder('gor_user_class') + 1000
                );
        $this->setIfExists('gor_iso_lang',
                'order', $this->getOrder('gor_user_class') + 1010,
                'default', $this->project->getLocaleDefault()
                );
        if ($this->_styles) {
            $this->setIfExists('gor_style');
        }
        return $this;
    }
774633
protected function adjustEndingPositions()
	{
		if ($this->closeEm && $this->closeStrong)
		{
			if ($this->emPos < $this->strongPos)
			{
				$this->emEndPos += 2;
			}
			else
			{
				++$this->strongEndPos;
			}
		}
	}
403683
private void applySettings() {
		container.reset();
		// Now show an example of the number of different columns

		WPanel gridLayoutPanel = new WPanel();

		if (cbResponsive.isSelected()) {
			gridLayoutPanel.setHtmlClass(HtmlClassProperties.RESPOND);
		}

		GridLayout layout = new GridLayout(rowCount.getValue().intValue(), columnCount.getValue()
				.intValue(),
				hGap.getValue().intValue(),
				vGap.getValue().intValue()
		);

		gridLayoutPanel.setLayout(layout);

		addBoxes(gridLayoutPanel, boxCount.getValue().intValue()); // give approx 3 rows, with a different number
		// of boxes on the final row
		container.add(gridLayoutPanel);

		gridLayoutPanel.setVisible(cbVisible.isSelected());
	}
451430
public function applyTypeSettings(): void{
        $settings = $this->getTypeSettings();
        $this->setTable($settings['table']);
        $this->setConnection($settings['connection']);
    }
507659
public void applyDefaults() {
		if (size == -1) {
			size = 8;
		}
		if (family == null) {
			family = "Verdana";
		}
		if (weight == null) {
			weight = "normal";
		}
		if (style == null) {
			style = "normal";
		}
		if (color == null) {
			color = "#000000"; // black
		}
		if (opacity == -1) {
			opacity = 1;
		}
	}
77370
protected function canvasSpacingY()
    {
        $this->canvas['spacing']['y'] = 0;

        if ($this->intermediate['height'] < $this->canvas['height']) {

            $difference = $this->canvas['height'] - $this->intermediate['height'];

            if ($difference % 2 === 0) {
                $this->canvas['spacing']['y'] = $difference / 2;
            } else {
                if ($difference > 1) {
                    $this->canvas['spacing']['y'] = ($difference - 1) / 2 + 1;
                } else {
                    $this->canvas['spacing']['y'] = 1;
                }
            }
        }
    }
1108224
function adjustPanes(x, y, overPreview) {
    var ratio = isLeftRight ?
        (x / $outer.clientWidth) :
        ((overPreview ? y : y - 25) / ($outer.clientHeight - 25));
    var psize = overPreview ? editorSize + ratio * 100 : ratio * 100;
    if (psize >= 0) { resizeEditor(psize); }
  }
261308
protected function setMargins()
    {
        // prepare the margins
        $this->_margeLeft   = $this->_defaultLeft   + (isset($this->_background['left'])   ? $this->_background['left']   : 0);
        $this->_margeRight  = $this->_defaultRight  + (isset($this->_background['right'])  ? $this->_background['right']  : 0);
        $this->_margeTop    = $this->_defaultTop    + (isset($this->_background['top'])    ? $this->_background['top']    : 0);
        $this->_margeBottom = $this->_defaultBottom + (isset($this->_background['bottom']) ? $this->_background['bottom'] : 0);

        // set the PDF margins
        $this->pdf->SetMargins($this->_margeLeft, $this->_margeTop, $this->_margeRight);
        $this->pdf->SetAutoPageBreak(false, $this->_margeBottom);

        // set the float Margins
        $this->_pageMarges = array();
        if ($this->_isInParagraph !== false) {
            $this->_pageMarges[floor($this->_margeTop*100)] = array($this->_isInParagraph[0], $this->pdf->getW()-$this->_isInParagraph[1]);
        } else {
            $this->_pageMarges[floor($this->_margeTop*100)] = array($this->_margeLeft, $this->pdf->getW()-$this->_margeRight);
        }
    }
972030
protected function setThemeConstants()
    {
        $this->parsedHeaders = $this->headers($this->dirPath.'/style.css', $this->headers);

        // Theme text domain.
        $textdomain = (isset($this->parsedHeaders['text_domain']) && ! empty($this->parsedHeaders['text_domain']))
            ? $this->parsedHeaders['text_domain']
            : 'themosis_theme';

        defined('THEME_TD') ? THEME_TD : define('THEME_TD', $textdomain);
    }
1214508
protected function setThemeProperties()
    {
        $this->theme_frontend = $this->config('theme', 'frontend');
        $this->theme_backend = $this->config('theme_backend', 'backend');

        if ($this->is_backend) {
            $this->theme = $this->theme_backend;
        } elseif ($this->is_install) {
            $this->theme = $this->theme_frontend;
        } elseif (!empty($this->current_store)) {
            $this->theme_frontend = $this->store->getConfig('theme');
            $this->theme = $this->theme_frontend;
        }

        $this->hook->attach('theme', $this);

        if (empty($this->theme)) {
            $this->response->outputError404();
        }

        $this->current_theme = $this->module->getInfo($this->theme);

        if (empty($this->current_theme)) {
            $this->response->outputError404();
        }

        $this->theme_settings = (array) $this->getModuleSettings($this->theme, null, array());
        $this->templates = $this->getDefaultTemplates();

        if (!empty($this->current_theme['data']['templates'])) {
            $this->templates = array_merge($this->templates, $this->current_theme['data']['templates']);
        }
    }
825277
def reset(self):
        
        self._fgcolor = self.default_fgcolor
        self._bgcolor = self.default_bgcolor
789938
private function reset(): void
    {
        $this->value = 0;
        $this->bg_color = null;
        $this->striped = false;
        $this->animate = false;
        $this->label = null;
        $this->height = null;
    }
44148
def standard_settings(self):
        """"""
        cmd.set('bg_rgb', [1.0, 1.0, 1.0])  # White background
        cmd.set('depth_cue', 0)  # Turn off depth cueing (no fog)
        cmd.set('cartoon_side_chain_helper', 1)  # Improve combined visualization of sticks and cartoon
        cmd.set('cartoon_fancy_helices', 1)  # Nicer visualization of helices (using tapered ends)
        cmd.set('transparency_mode', 1)  # Turn on multilayer transparency
        cmd.set('dash_radius', 0.05)
        self.set_custom_colorset()