Fix settings drafts, enlarge avatars, and show desktop version
This commit is contained in:
1 parent
f408abcf4e
commit
efebf8c5e8
5 files changed
+14
-8
No files matched your search
+2
-2
@@ -84,7 +84,7 @@ fun ConversationMessages(target: ConversationTarget, messages: List<Message>, st
|
||||
val group = (target as? ConversationTarget.Channel)?.id
|
||||
Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.Bottom) {
|
||||
if (!message.isOutgoing) UserAvatar(group, message.authorNodeId, message.author,
|
||||
modifier = Modifier.padding(start = 8.dp, bottom = 4.dp), size = 32.dp)
|
||||
modifier = Modifier.padding(start = 8.dp, bottom = 4.dp), size = 54.4.dp)
|
||||
Box(Modifier.weight(1f)) {
|
||||
Column {
|
||||
val footer: @Composable () -> Unit = {
|
||||
@@ -98,7 +98,7 @@ fun ConversationMessages(target: ConversationTarget, messages: List<Message>, st
|
||||
}
|
||||
}
|
||||
if (message.isOutgoing) UserAvatar(group, message.authorNodeId, message.author,
|
||||
modifier = Modifier.padding(end = 8.dp, bottom = 4.dp), size = 32.dp)
|
||||
modifier = Modifier.padding(end = 8.dp, bottom = 4.dp), size = 54.4.dp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ add_executable(vibechat
|
||||
add_dependencies(vibechat chatgui_translations)
|
||||
|
||||
target_include_directories(vibechat PRIVATE ${CMAKE_SOURCE_DIR}/../../lib ${CMAKE_SOURCE_DIR}/../../src ${CMAKE_SOURCE_DIR}/db ${CMAKE_SOURCE_DIR}/../../lib/libopus/include ${FFMPEG_INCLUDE_DIRS})
|
||||
target_compile_definitions(vibechat PRIVATE SQLITE_THREADSAFE=1 USE_SQLITE)
|
||||
target_compile_definitions(vibechat PRIVATE SQLITE_THREADSAFE=1 USE_SQLITE VIBECHAT_VERSION="${PROJECT_VERSION}")
|
||||
|
||||
# Лицензии лежат рядом с бинарником при сборке и устанавливаются с приложением.
|
||||
set(UTUN_LICENSE_FILES
|
||||
|
||||
@@ -199,6 +199,10 @@ ChannelList::ChannelList(DbManager* db, QWidget *parent)
|
||||
|
||||
fl->addStretch();
|
||||
|
||||
auto* versionLabel = new QLabel(QStringLiteral("v%1").arg(QCoreApplication::applicationVersion()), footer);
|
||||
versionLabel->setStyleSheet("font-size: 10px; color: palette(mid);");
|
||||
fl->addWidget(versionLabel);
|
||||
|
||||
auto *createBtn = new QPushButton(QCoreApplication::translate("ChatGui", "GRP"), footer);
|
||||
createBtn->setFixedSize(36, 28);
|
||||
createBtn->setToolTip(QCoreApplication::translate("ChatGui", "Create group"));
|
||||
|
||||
@@ -79,6 +79,7 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("vibechat");
|
||||
app.setApplicationVersion(QStringLiteral(VIBECHAT_VERSION));
|
||||
app.setDesktopFileName("org.utun.vibechat");
|
||||
app.setWindowIcon(QIcon(":/icons/app_icon.png"));
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
@@ -181,6 +182,7 @@ int main(int argc, char *argv[]) {
|
||||
QString lvl = cfg.debugLevel().trimmed();
|
||||
if (lvl.isEmpty()) lvl = QStringLiteral("info");
|
||||
debug_apply_global_level(lvl.toUtf8().constData());
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "vibechat: version=%s", qPrintable(app.applicationVersion()));
|
||||
DEBUG_INFO(DEBUG_CATEGORY_CONFIG, "GUI language: preference=%s system=%s selected=%s",
|
||||
qPrintable(cfg.language()), qPrintable(QLocale::system().uiLanguages().join(',')), qPrintable(language));
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, UtunNod
|
||||
connect(m_categoryList, &QListWidget::currentRowChanged,
|
||||
this, &SettingsDialog::onCategoryChanged);
|
||||
|
||||
// Load current values
|
||||
// Черновик всех редактируемых страниц загружаем один раз на время жизни диалога.
|
||||
loadProfileFromConfig(m_configPath);
|
||||
if (db) {
|
||||
int sortMode = db->getUiStateInt("channel_sort", 0);
|
||||
@@ -255,7 +255,9 @@ SettingsDialog::SettingsDialog(const QString& configPath, DbManager* db, UtunNod
|
||||
m_autoConnectCheck->setChecked(db->getUiStateInt("group_autoconnect", 1) != 0);
|
||||
}
|
||||
m_networkPage->loadFromConfig(m_configPath);
|
||||
m_storagePage->loadFromDb();
|
||||
m_soundPage->loadFromDb();
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_CONFIG, "Settings: draft initialized; editable pages retain values until Save or Cancel");
|
||||
m_categoryList->setCurrentRow(0);
|
||||
}
|
||||
|
||||
@@ -276,13 +278,11 @@ void SettingsDialog::loadProfileFromConfig(const QString& path) {
|
||||
|
||||
void SettingsDialog::onCategoryChanged(int row) {
|
||||
m_pages->setCurrentIndex(row);
|
||||
if (row == 1) m_storagePage->loadFromDb();
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_CONFIG, "Settings: selected page=%d; draft retained", row);
|
||||
// При переключении обновляем только диагностические страницы.
|
||||
if (row == 4) m_databasePage->refreshStatus();
|
||||
if (row == 5) m_statusPage->refreshStatus();
|
||||
if (row == 6) m_nodesPage->refreshNodes();
|
||||
if (row == 7) m_soundPage->loadFromDb();
|
||||
if (row == 8) m_audioDevicePage->loadFromDb();
|
||||
if (row == 9) m_radioPage->loadFromDb();
|
||||
}
|
||||
|
||||
void SettingsDialog::onSave() {
|
||||
|
||||
Reference in new issue
Block a user