Search in sources :

Example 1 with ColorSwtParameter

use of com.biglybt.ui.swt.config.ColorSwtParameter in project BiglyBT by BiglySoftware.

the class ConfigSectionInterfaceColorSWT method configSectionCreate.

@Override
public void configSectionCreate(Composite parent, Map<ParameterImpl, BaseSwtParameter> mapParamToSwtParam) {
    boolean isAZ3 = COConfigurationManager.getStringParameter("ui").equals("az3");
    if (!isAZ3) {
        return;
    }
    BaseSwtParameter pg = mapParamToSwtParam.get(getPluginParam("ConfigView.section.style.colorOverrides"));
    if (pg == null) {
        return;
    }
    Composite cColorOverride = (Composite) pg.getMainControl();
    Display display = cColorOverride.getDisplay();
    Label label;
    GridData gridData;
    // These keys are referenced in skin properties (skin3_constants)
    String[][] override_keys_blocks = { { // Doesn't require restart
    "config.skin.color.sidebar.bg" }, { // Requires Restart
    "config.skin.color.library.header" } };
    SkinColorValueProcessor skinColorValueProcessor = new SkinColorValueProcessor(display);
    for (int i = 0; i < override_keys_blocks.length; i++) {
        if (i == 1) {
            label = new Label(cColorOverride, SWT.NULL);
            gridData = new GridData(GridData.FILL_HORIZONTAL);
            gridData.horizontalSpan = 2;
            label.setLayoutData(gridData);
            label = new Label(cColorOverride, SWT.NULL);
            Messages.setLanguageText(label, "restart.required.for.following");
            gridData = new GridData(GridData.FILL_HORIZONTAL);
            gridData.horizontalSpan = 2;
            label.setLayoutData(gridData);
        }
        String[] override_keys = override_keys_blocks[i];
        for (final String key : override_keys) {
            new ColorSwtParameter(cColorOverride, key, key, null, true, skinColorValueProcessor);
        }
    }
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ColorSwtParameter(com.biglybt.ui.swt.config.ColorSwtParameter) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) BaseSwtParameter(com.biglybt.ui.swt.config.BaseSwtParameter) Display(org.eclipse.swt.widgets.Display)

Aggregations

BaseSwtParameter (com.biglybt.ui.swt.config.BaseSwtParameter)1 ColorSwtParameter (com.biglybt.ui.swt.config.ColorSwtParameter)1 GridData (org.eclipse.swt.layout.GridData)1 Composite (org.eclipse.swt.widgets.Composite)1 Display (org.eclipse.swt.widgets.Display)1 Label (org.eclipse.swt.widgets.Label)1