]> git.sesse.net Git - nageru/commitdiff
Tweak the look of the input mapping dialog box a bit.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 30 Jul 2016 23:37:54 +0000 (01:37 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 19 Oct 2016 22:55:44 +0000 (00:55 +0200)
input_mapping_dialog.cpp

index ea20fdc38f4a0c33f79ad1e0b9d5a62d594fd922..e411318f7ae2636020f19156aabf63a00d66a223 100644 (file)
@@ -19,6 +19,10 @@ InputMappingDialog::InputMappingDialog()
 void InputMappingDialog::fill_ui_from_mapping(const InputMapping &mapping, const vector<string> &card_names)
 {
        ui->table->verticalHeader()->hide();
+       ui->table->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+       ui->table->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
+       ui->table->horizontalHeader()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
+       ui->table->horizontalHeader()->setSectionsClickable(false);
 
        ui->table->setRowCount(mapping.inputs.size());
        for (unsigned row = 0; row < mapping.inputs.size(); ++row) {
@@ -28,9 +32,9 @@ void InputMappingDialog::fill_ui_from_mapping(const InputMapping &mapping, const
 
                // Card choices.
                QComboBox *card_combo = new QComboBox;
-               card_combo->addItem(QString("(none)"));
+               card_combo->addItem(QString("(none)   "));
                for (const string &name : card_names) {
-                       card_combo->addItem(QString::fromStdString(name));
+                       card_combo->addItem(QString::fromStdString(name + "   "));
                }
                switch (mapping.inputs[row].input_source_type) {
                case InputSourceType::SILENCE:
@@ -57,7 +61,7 @@ void InputMappingDialog::fill_channel_ui_from_mapping(unsigned row, const InputM
                if (input.input_source_type == InputSourceType::CAPTURE_CARD) {
                        for (unsigned source = 0; source < 8; ++source) {  // TODO: Ask the card about number of channels, and names.
                                char buf[256];
-                               snprintf(buf, sizeof(buf), "Channel %u", source + 1);
+                               snprintf(buf, sizeof(buf), "Channel %u   ", source + 1);
                                channel_combo->addItem(QString(buf));
                        }
                }