Compare commits

..

No commits in common. "f549d5a70adda7a75011014aab0de4337c2f027e" and "0a45dd384e29de4e8e282935a206e874b6ddd569" have entirely different histories.

41 changed files with 614 additions and 1288 deletions

View File

@ -381,9 +381,10 @@ void bert_eval(
struct ggml_tensor *KQ = ggml_mul_mat(ctx0, K, Q); struct ggml_tensor *KQ = ggml_mul_mat(ctx0, K, Q);
// KQ = soft_max(KQ / sqrt(head width)) // KQ = soft_max(KQ / sqrt(head width))
KQ = ggml_soft_max( KQ = ggml_soft_max(ctx0,
ctx0, ggml_scale(ctx0, KQ, 1.0f / sqrt((float)d_head)) ggml_scale(ctx0,
); KQ,
ggml_new_f32(ctx0, 1.0f / sqrt((float)d_head))));
V = ggml_cont(ctx0, ggml_transpose(ctx0, V)); V = ggml_cont(ctx0, ggml_transpose(ctx0, V));
struct ggml_tensor *KQV = ggml_mul_mat(ctx0, V, KQ); struct ggml_tensor *KQV = ggml_mul_mat(ctx0, V, KQ);
@ -489,6 +490,10 @@ struct bert_ctx * bert_load_from_file(const char *fname)
#endif #endif
bert_ctx * new_bert = new bert_ctx; bert_ctx * new_bert = new bert_ctx;
#if defined(GGML_USE_KOMPUTE)
new_bert->buf_compute.force_cpu = true;
new_bert->work_buf.force_cpu = true;
#endif
bert_model & model = new_bert->model; bert_model & model = new_bert->model;
bert_vocab & vocab = new_bert->vocab; bert_vocab & vocab = new_bert->vocab;

View File

@ -414,7 +414,11 @@ bool gptj_eval(
struct ggml_tensor * KQ = ggml_mul_mat(ctx0, K, Q); struct ggml_tensor * KQ = ggml_mul_mat(ctx0, K, Q);
// KQ_scaled = KQ / sqrt(n_embd/n_head) // KQ_scaled = KQ / sqrt(n_embd/n_head)
struct ggml_tensor * KQ_scaled = ggml_scale(ctx0, KQ, 1.0f/sqrt(float(n_embd)/n_head)); struct ggml_tensor * KQ_scaled =
ggml_scale(ctx0,
KQ,
ggml_new_f32(ctx0, 1.0f/sqrt(float(n_embd)/n_head))
);
// KQ_masked = mask_past(KQ_scaled) // KQ_masked = mask_past(KQ_scaled)
struct ggml_tensor * KQ_masked = ggml_diag_mask_inf(ctx0, KQ_scaled, n_past); struct ggml_tensor * KQ_masked = ggml_diag_mask_inf(ctx0, KQ_scaled, n_past);

@ -1 +1 @@
Subproject commit 28921b84e4547c42fd7d23615d92c9d894a6cc2d Subproject commit 01307d86bbe980128308c36b64c494fb9dbaa5bf

View File

@ -175,7 +175,6 @@ if (LLAMA_KOMPUTE)
DEPENDS ${LLAMA_DIR}/${source} DEPENDS ${LLAMA_DIR}/${source}
${LLAMA_DIR}/kompute-shaders/common.comp ${LLAMA_DIR}/kompute-shaders/common.comp
${LLAMA_DIR}/kompute-shaders/op_getrows.comp ${LLAMA_DIR}/kompute-shaders/op_getrows.comp
${LLAMA_DIR}/kompute-shaders/op_mul_mv_q_n_pre.comp
${LLAMA_DIR}/kompute-shaders/op_mul_mv_q_n.comp ${LLAMA_DIR}/kompute-shaders/op_mul_mv_q_n.comp
COMMAND ${glslc_executable} --target-env=vulkan1.2 -o ${spv_file} ${LLAMA_DIR}/${source} COMMAND ${glslc_executable} --target-env=vulkan1.2 -o ${spv_file} ${LLAMA_DIR}/${source}
COMMENT "Compiling ${source} to ${source}.spv" COMMENT "Compiling ${source} to ${source}.spv"
@ -232,6 +231,7 @@ if (LLAMA_KOMPUTE)
kompute-shaders/op_add.comp kompute-shaders/op_add.comp
kompute-shaders/op_addrow.comp kompute-shaders/op_addrow.comp
kompute-shaders/op_mul.comp kompute-shaders/op_mul.comp
kompute-shaders/op_mulrow.comp
kompute-shaders/op_silu.comp kompute-shaders/op_silu.comp
kompute-shaders/op_relu.comp kompute-shaders/op_relu.comp
kompute-shaders/op_gelu.comp kompute-shaders/op_gelu.comp
@ -264,6 +264,7 @@ if (LLAMA_KOMPUTE)
shaderop_add.h shaderop_add.h
shaderop_addrow.h shaderop_addrow.h
shaderop_mul.h shaderop_mul.h
shaderop_mulrow.h
shaderop_silu.h shaderop_silu.h
shaderop_relu.h shaderop_relu.h
shaderop_gelu.h shaderop_gelu.h

View File

@ -96,7 +96,6 @@ static int llama_sample_top_p_top_k(
struct LLamaPrivate { struct LLamaPrivate {
const std::string modelPath; const std::string modelPath;
bool modelLoaded; bool modelLoaded;
int device = -1;
llama_model *model = nullptr; llama_model *model = nullptr;
llama_context *ctx = nullptr; llama_context *ctx = nullptr;
llama_model_params model_params; llama_model_params model_params;
@ -168,17 +167,24 @@ bool LLamaModel::loadModel(const std::string &modelPath, int n_ctx)
if (llama_verbose()) { if (llama_verbose()) {
std::cerr << "llama.cpp: using Metal" << std::endl; std::cerr << "llama.cpp: using Metal" << std::endl;
} }
d_ptr->model_params.n_gpu_layers = 100; // metal always runs the whole model if n_gpu_layers is not 0, at least
#elif defined(GGML_USE_KOMPUTE) // currently
if (d_ptr->device != -1) { d_ptr->model_params.n_gpu_layers = 1;
d_ptr->model_params.main_gpu = d_ptr->device; #endif
d_ptr->model_params.n_gpu_layers = 100; #ifdef GGML_USE_KOMPUTE
if (ggml_vk_has_device()) {
// vulkan always runs the whole model if n_gpu_layers is not 0, at least
// currently
d_ptr->model_params.n_gpu_layers = 1;
} }
#endif #endif
d_ptr->model = llama_load_model_from_file_gpt4all(modelPath.c_str(), &d_ptr->model_params); d_ptr->model = llama_load_model_from_file_gpt4all(modelPath.c_str(), &d_ptr->model_params);
if (!d_ptr->model) { if (!d_ptr->model) {
d_ptr->device = -1; #ifdef GGML_USE_KOMPUTE
// Explicitly free the device so next load it doesn't use it
ggml_vk_free_device();
#endif
std::cerr << "LLAMA ERROR: failed to load model from " << modelPath << std::endl; std::cerr << "LLAMA ERROR: failed to load model from " << modelPath << std::endl;
return false; return false;
} }
@ -208,7 +214,10 @@ bool LLamaModel::loadModel(const std::string &modelPath, int n_ctx)
d_ptr->ctx = llama_new_context_with_model(d_ptr->model, d_ptr->ctx_params); d_ptr->ctx = llama_new_context_with_model(d_ptr->model, d_ptr->ctx_params);
if (!d_ptr->ctx) { if (!d_ptr->ctx) {
d_ptr->device = -1; #ifdef GGML_USE_KOMPUTE
// Explicitly free the device so next load it doesn't use it
ggml_vk_free_device();
#endif
std::cerr << "LLAMA ERROR: failed to init context for model " << modelPath << std::endl; std::cerr << "LLAMA ERROR: failed to init context for model " << modelPath << std::endl;
return false; return false;
} }
@ -216,7 +225,7 @@ bool LLamaModel::loadModel(const std::string &modelPath, int n_ctx)
d_ptr->end_tokens = {llama_token_eos(d_ptr->model)}; d_ptr->end_tokens = {llama_token_eos(d_ptr->model)};
#ifdef GGML_USE_KOMPUTE #ifdef GGML_USE_KOMPUTE
if (usingGPUDevice() && ggml_vk_has_device()) { if (ggml_vk_has_device()) {
std::cerr << "llama.cpp: using Vulkan on " << ggml_vk_current_device().name << std::endl; std::cerr << "llama.cpp: using Vulkan on " << ggml_vk_current_device().name << std::endl;
} }
#endif #endif
@ -330,70 +339,62 @@ const std::vector<LLModel::Token> &LLamaModel::endTokens() const
std::vector<LLModel::GPUDevice> LLamaModel::availableGPUDevices(size_t memoryRequired) std::vector<LLModel::GPUDevice> LLamaModel::availableGPUDevices(size_t memoryRequired)
{ {
#if defined(GGML_USE_KOMPUTE) #if defined(GGML_USE_KOMPUTE)
size_t count = 0; std::vector<ggml_vk_device> vkDevices = ggml_vk_available_devices(memoryRequired);
auto * vkDevices = ggml_vk_available_devices(memoryRequired, &count);
if (vkDevices) { std::vector<LLModel::GPUDevice> devices;
std::vector<LLModel::GPUDevice> devices; for(const auto& vkDevice : vkDevices) {
devices.reserve(count); LLModel::GPUDevice device;
device.index = vkDevice.index;
device.type = vkDevice.type;
device.heapSize = vkDevice.heapSize;
device.name = vkDevice.name;
device.vendor = vkDevice.vendor;
for (size_t i = 0; i < count; ++i) { devices.push_back(device);
auto & dev = vkDevices[i];
devices.emplace_back(
/* index = */ dev.index,
/* type = */ dev.type,
/* heapSize = */ dev.heapSize,
/* name = */ dev.name,
/* vendor = */ dev.vendor
);
}
free(vkDevices);
return devices;
} }
#endif
return {}; return devices;
#else
return std::vector<LLModel::GPUDevice>();
#endif
} }
bool LLamaModel::initializeGPUDevice(size_t memoryRequired, const std::string &name) bool LLamaModel::initializeGPUDevice(size_t memoryRequired, const std::string& device)
{ {
#if defined(GGML_USE_KOMPUTE) #if defined(GGML_USE_KOMPUTE)
ggml_vk_device device; return ggml_vk_init_device(memoryRequired, device);
bool ok = ggml_vk_get_device(&device, memoryRequired, name.c_str());
if (ok) {
d_ptr->device = device.index;
return true;
}
#else #else
(void)memoryRequired;
(void)name;
#endif
return false; return false;
#endif
} }
bool LLamaModel::initializeGPUDevice(const LLModel::GPUDevice &device, std::string *unavail_reason) bool LLamaModel::initializeGPUDevice(const LLModel::GPUDevice &device, std::string *unavail_reason)
{ {
bool result = false;
#if defined(GGML_USE_KOMPUTE) #if defined(GGML_USE_KOMPUTE)
(void)unavail_reason; ggml_vk_device vkDevice;
d_ptr->device = device.index; vkDevice.index = device.index;
return true; vkDevice.type = device.type;
vkDevice.heapSize = device.heapSize;
vkDevice.name = device.name;
vkDevice.vendor = device.vendor;
result = ggml_vk_init_device(vkDevice);
if (!result && unavail_reason) {
*unavail_reason = "failed to init GPU";
}
#else #else
(void)device;
if (unavail_reason) { if (unavail_reason) {
*unavail_reason = "built without Kompute"; *unavail_reason = "built without Kompute";
} }
return false;
#endif #endif
return result;
} }
bool LLamaModel::initializeGPUDevice(int device) bool LLamaModel::initializeGPUDevice(int device)
{ {
#if defined(GGML_USE_KOMPUTE) #if defined(GGML_USE_KOMPUTE)
d_ptr->device = device; return ggml_vk_init_device(device);
return true;
#else #else
(void)device;
return false; return false;
#endif #endif
} }
@ -401,7 +402,7 @@ bool LLamaModel::initializeGPUDevice(int device)
bool LLamaModel::hasGPUDevice() bool LLamaModel::hasGPUDevice()
{ {
#if defined(GGML_USE_KOMPUTE) #if defined(GGML_USE_KOMPUTE)
return d_ptr->device != -1; return ggml_vk_has_device();
#else #else
return false; return false;
#endif #endif
@ -410,12 +411,11 @@ bool LLamaModel::hasGPUDevice()
bool LLamaModel::usingGPUDevice() bool LLamaModel::usingGPUDevice()
{ {
#if defined(GGML_USE_KOMPUTE) #if defined(GGML_USE_KOMPUTE)
return hasGPUDevice() && d_ptr->model_params.n_gpu_layers > 0; return ggml_vk_using_vulkan();
#elif defined(GGML_USE_METAL) #elif defined(GGML_USE_METAL)
return true; return true;
#else
return false;
#endif #endif
return false;
} }
std::string get_arch_name(gguf_context *ctx_gguf) { std::string get_arch_name(gguf_context *ctx_gguf) {

View File

@ -26,7 +26,7 @@ public:
void setThreadCount(int32_t n_threads) override; void setThreadCount(int32_t n_threads) override;
int32_t threadCount() const override; int32_t threadCount() const override;
std::vector<GPUDevice> availableGPUDevices(size_t memoryRequired) override; std::vector<GPUDevice> availableGPUDevices(size_t memoryRequired) override;
bool initializeGPUDevice(size_t memoryRequired, const std::string& name) override; bool initializeGPUDevice(size_t memoryRequired, const std::string& device) override;
bool initializeGPUDevice(const GPUDevice &device, std::string *unavail_reason) override; bool initializeGPUDevice(const GPUDevice &device, std::string *unavail_reason) override;
bool initializeGPUDevice(int device) override; bool initializeGPUDevice(int device) override;
bool hasGPUDevice() override; bool hasGPUDevice() override;

View File

@ -17,14 +17,11 @@ public:
using Token = int32_t; using Token = int32_t;
struct GPUDevice { struct GPUDevice {
int index; int index = 0;
int type; int type = 0;
size_t heapSize; size_t heapSize = 0;
std::string name; std::string name;
std::string vendor; std::string vendor;
GPUDevice(int index, int type, size_t heapSize, std::string name, std::string vendor):
index(index), type(type), heapSize(heapSize), name(std::move(name)), vendor(std::move(vendor)) {}
}; };
class Implementation { class Implementation {
@ -101,25 +98,14 @@ public:
return *m_implementation; return *m_implementation;
} }
virtual std::vector<GPUDevice> availableGPUDevices(size_t memoryRequired) { virtual std::vector<GPUDevice> availableGPUDevices(size_t /*memoryRequired*/) { return std::vector<GPUDevice>(); }
(void)memoryRequired; virtual bool initializeGPUDevice(size_t /*memoryRequired*/, const std::string& /*device*/) { return false; }
return {}; virtual bool initializeGPUDevice(const GPUDevice &/*device*/, std::string *unavail_reason = nullptr) {
}
virtual bool initializeGPUDevice(size_t memoryRequired, const std::string& name) {
(void)memoryRequired;
(void)name;
return false;
}
virtual bool initializeGPUDevice(const GPUDevice & device, std::string *unavail_reason = nullptr) {
(void)device;
if (unavail_reason) { if (unavail_reason) {
*unavail_reason = "model has no GPU support"; *unavail_reason = "model has no GPU support";
} }
return false; return false;
} }
virtual bool initializeGPUDevice(int /*device*/) { return false; } virtual bool initializeGPUDevice(int /*device*/) { return false; }
virtual bool hasGPUDevice() { return false; } virtual bool hasGPUDevice() { return false; }
virtual bool usingGPUDevice() { return false; } virtual bool usingGPUDevice() { return false; }

View File

@ -230,13 +230,12 @@ bool llmodel_gpu_init_gpu_device_by_string(llmodel_model model, size_t memoryReq
bool llmodel_gpu_init_gpu_device_by_struct(llmodel_model model, const llmodel_gpu_device *device) bool llmodel_gpu_init_gpu_device_by_struct(llmodel_model model, const llmodel_gpu_device *device)
{ {
LLModel::GPUDevice d( LLModel::GPUDevice d;
/* index = */ device->index, d.index = device->index;
/* type = */ device->type, d.type = device->type;
/* heapSize = */ device->heapSize, d.heapSize = device->heapSize;
/* name = */ device->name, d.name = device->name;
/* vendor = */ device->vendor d.vendor = device->vendor;
);
LLModelWrapper *wrapper = reinterpret_cast<LLModelWrapper*>(model); LLModelWrapper *wrapper = reinterpret_cast<LLModelWrapper*>(model);
return wrapper->llModel->initializeGPUDevice(d); return wrapper->llModel->initializeGPUDevice(d);
} }

View File

@ -4,6 +4,50 @@
#include <vector> #include <vector>
#include <ggml.h> #include <ggml.h>
#if defined(GGML_USE_KOMPUTE)
#include "ggml-kompute.h"
struct llm_buffer {
uint8_t * addr = NULL;
size_t size = 0;
ggml_vk_memory memory;
bool force_cpu = false;
llm_buffer() = default;
void resize(size_t size) {
free();
if (!ggml_vk_has_device() || force_cpu) {
this->addr = new uint8_t[size];
this->size = size;
} else {
this->memory = ggml_vk_allocate(size);
this->addr = (uint8_t*)memory.data;
this->size = size;
}
}
void free() {
if (!memory.primaryMemory) {
delete[] addr;
} else if (memory.data) {
ggml_vk_free_memory(memory);
}
this->addr = NULL;
this->size = 0;
}
~llm_buffer() {
free();
}
// disable copy and move
llm_buffer(const llm_buffer&) = delete;
llm_buffer(llm_buffer&&) = delete;
llm_buffer& operator=(const llm_buffer&) = delete;
llm_buffer& operator=(llm_buffer&&) = delete;
};
#else
struct llm_buffer { struct llm_buffer {
uint8_t * addr = NULL; uint8_t * addr = NULL;
size_t size = 0; size_t size = 0;
@ -18,6 +62,7 @@ struct llm_buffer {
delete[] addr; delete[] addr;
} }
}; };
#endif
struct llm_kv_cache { struct llm_kv_cache {
struct ggml_tensor * k; struct ggml_tensor * k;

View File

@ -111,15 +111,10 @@ qt_add_qml_module(chat
qml/LocalDocsSettings.qml qml/LocalDocsSettings.qml
qml/MySettingsTab.qml qml/MySettingsTab.qml
qml/MySettingsStack.qml qml/MySettingsStack.qml
qml/MySettingsDestructiveButton.qml
qml/MySettingsButton.qml
qml/MySettingsLabel.qml
qml/MySlug.qml
qml/MyButton.qml qml/MyButton.qml
qml/MyComboBox.qml qml/MyComboBox.qml
qml/MyDialog.qml qml/MyDialog.qml
qml/MyDirectoryField.qml qml/MyDirectoryField.qml
qml/MyTextArea.qml
qml/MyTextField.qml qml/MyTextField.qml
qml/MyCheckBox.qml qml/MyCheckBox.qml
qml/MyBusyIndicator.qml qml/MyBusyIndicator.qml

View File

@ -112,7 +112,7 @@ void Chat::resetResponseState()
m_tokenSpeed = QString(); m_tokenSpeed = QString();
emit tokenSpeedChanged(); emit tokenSpeedChanged();
m_responseInProgress = true; m_responseInProgress = true;
m_responseState = m_collections.empty() ? Chat::PromptProcessing : Chat::LocalDocsRetrieval; m_responseState = Chat::LocalDocsRetrieval;
emit responseInProgressChanged(); emit responseInProgressChanged();
emit responseStateChanged(); emit responseStateChanged();
} }
@ -120,7 +120,7 @@ void Chat::resetResponseState()
void Chat::prompt(const QString &prompt) void Chat::prompt(const QString &prompt)
{ {
resetResponseState(); resetResponseState();
emit promptRequested(m_collections, prompt); emit promptRequested( m_collections, prompt);
} }
void Chat::regenerateResponse() void Chat::regenerateResponse()

View File

@ -14,10 +14,10 @@ import mysettings
Window { Window {
id: window id: window
width: 1920 width: 1280
height: 1080 height: 720
minimumWidth: 1280 minimumWidth: 720
minimumHeight: 720 minimumHeight: 480
visible: true visible: true
title: qsTr("GPT4All v") + Qt.application.version title: qsTr("GPT4All v") + Qt.application.version
@ -47,7 +47,7 @@ Window {
} }
} }
color: theme.black color: theme.backgroundDarkest
// Startup code // Startup code
Component.onCompleted: { Component.onCompleted: {
@ -197,98 +197,13 @@ Window {
+ "<li>Check out our <a href=\"https://discord.gg/4M2QFmTt2k\">discord channel</a> for help") + "<li>Check out our <a href=\"https://discord.gg/4M2QFmTt2k\">discord channel</a> for help")
} }
Rectangle {
id: accentRibbon
anchors.left: parent.left
anchors.right: parent.right
anchors.top: header.bottom
height: 3
color: theme.accentColor
}
Rectangle {
id: titleBar
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.topMargin: 5
z: 200
height: 25
color: "transparent"
RowLayout {
anchors.left: parent.left
anchors.leftMargin: 30
Text {
textFormat: Text.StyledText
text: "<a href=\"https://gpt4all.io\">gpt4all.io</a> |"
horizontalAlignment: Text.AlignLeft
font.pixelSize: theme.fontSizeFixedSmall
color: theme.iconBackgroundLight
linkColor: hoverHandler1.hovered ? theme.iconBackgroundHovered : theme.iconBackgroundLight
HoverHandler { id: hoverHandler1 }
onLinkActivated: { Qt.openUrlExternally("https://gpt4all.io") }
}
Text {
textFormat: Text.StyledText
text: "<a href=\"https://github.com/nomic-ai/gpt4all\">github</a>"
horizontalAlignment: Text.AlignLeft
font.pixelSize: theme.fontSizeFixedSmall
color: theme.iconBackgroundLight
linkColor: hoverHandler2.hovered ? theme.iconBackgroundHovered : theme.iconBackgroundLight
HoverHandler { id: hoverHandler2 }
onLinkActivated: { Qt.openUrlExternally("https://github.com/nomic-ai/gpt4all") }
}
}
RowLayout {
anchors.right: parent.right
anchors.rightMargin: 30
Text {
textFormat: Text.StyledText
text: "<a href=\"https://nomic.ai\">nomic.ai</a> |"
horizontalAlignment: Text.AlignRight
font.pixelSize: theme.fontSizeFixedSmall
color: theme.iconBackgroundLight
linkColor: hoverHandler3.hovered ? theme.iconBackgroundHovered : theme.iconBackgroundLight
HoverHandler { id: hoverHandler3 }
onLinkActivated: { Qt.openUrlExternally("https://nomic.ai") }
}
Text {
textFormat: Text.StyledText
text: "<a href=\"https://twitter.com/nomic_ai\">twitter</a> |"
horizontalAlignment: Text.AlignRight
font.pixelSize: theme.fontSizeFixedSmall
color: theme.iconBackgroundLight
linkColor: hoverHandler4.hovered ? theme.iconBackgroundHovered : theme.iconBackgroundLight
HoverHandler { id: hoverHandler4 }
onLinkActivated: { Qt.openUrlExternally("https://twitter.com/nomic_ai") }
}
Text {
textFormat: Text.StyledText
text: "<a href=\"https://discord.gg/4M2QFmTt2k\">discord</a>"
horizontalAlignment: Text.AlignRight
font.pixelSize: theme.fontSizeFixedSmall
color: theme.iconBackgroundLight
linkColor: hoverHandler5.hovered ? theme.iconBackgroundHovered : theme.iconBackgroundLight
HoverHandler { id: hoverHandler5 }
onLinkActivated: { Qt.openUrlExternally("https://discord.gg/4M2QFmTt2k") }
}
}
}
Rectangle { Rectangle {
id: header id: header
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
height: 100 height: 100
color: theme.mainHeader color: theme.backgroundDarkest
Item { Item {
anchors.centerIn: parent anchors.centerIn: parent
height: childrenRect.height height: childrenRect.height
@ -301,7 +216,7 @@ Window {
font.pixelSize: theme.fontSizeLarger font.pixelSize: theme.fontSizeLarger
text: "" text: ""
background: Rectangle { background: Rectangle {
color: theme.mainHeader color: theme.backgroundDarkest
} }
horizontalAlignment: TextInput.AlignRight horizontalAlignment: TextInput.AlignRight
} }
@ -336,7 +251,7 @@ Window {
} }
} }
background: Rectangle { background: Rectangle {
color: theme.mainComboBackground color: theme.backgroundDark
radius: 10 radius: 10
} }
contentItem: Text { contentItem: Text {
@ -346,8 +261,8 @@ Window {
text: currentChat.modelLoadingError !== "" text: currentChat.modelLoadingError !== ""
? qsTr("Model loading error...") ? qsTr("Model loading error...")
: comboBox.currentModelName : comboBox.currentModelName
font.pixelSize: theme.fontSizeLarger font: comboBox.font
color: theme.white color: theme.textColor
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight elide: Text.ElideRight
@ -362,9 +277,7 @@ Window {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
background: Rectangle { background: Rectangle {
color: (index % 2 === 0 ? theme.darkContrast : theme.lightContrast) color: highlighted ? theme.backgroundLight : theme.backgroundDark
border.width: highlighted
border.color: theme.accentColor
} }
highlighted: comboBox.highlightedIndex === index highlighted: comboBox.highlightedIndex === index
} }
@ -401,7 +314,7 @@ Window {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: qsTr("Loading model...") text: qsTr("Loading model...")
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarge
color: theme.oppositeTextColor color: theme.textAccent
} }
} }
} }
@ -422,7 +335,7 @@ Window {
id: drawerButton id: drawerButton
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 42.5 anchors.topMargin: 30
anchors.leftMargin: 30 anchors.leftMargin: 30
width: 40 width: 40
height: 40 height: 40
@ -440,7 +353,7 @@ Window {
Rectangle { Rectangle {
id: bar1 id: bar1
color: drawerButton.hovered ? theme.iconBackgroundHovered : theme.iconBackgroundLight color: drawerButton.hovered ? theme.textColor : theme.backgroundLightest
width: parent.width width: parent.width
height: 6 height: 6
radius: 2 radius: 2
@ -450,7 +363,7 @@ Window {
Rectangle { Rectangle {
id: bar2 id: bar2
anchors.centerIn: parent anchors.centerIn: parent
color: drawerButton.hovered ? theme.iconBackgroundHovered : theme.iconBackgroundLight color: drawerButton.hovered ? theme.textColor : theme.backgroundLightest
width: parent.width width: parent.width
height: 6 height: 6
radius: 2 radius: 2
@ -460,7 +373,7 @@ Window {
Rectangle { Rectangle {
id: bar3 id: bar3
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
color: drawerButton.hovered ? theme.iconBackgroundHovered : theme.iconBackgroundLight color: drawerButton.hovered ? theme.textColor : theme.backgroundLightest
width: parent.width width: parent.width
height: 6 height: 6
radius: 2 radius: 2
@ -486,10 +399,9 @@ Window {
MyToolButton { MyToolButton {
id: networkButton id: networkButton
backgroundColor: theme.iconBackgroundLight
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 42.5 anchors.topMargin: 30
anchors.rightMargin: 30 anchors.rightMargin: 30
width: 40 width: 40
height: 40 height: 40
@ -527,13 +439,12 @@ Window {
MyToolButton { MyToolButton {
id: collectionsButton id: collectionsButton
backgroundColor: theme.iconBackgroundLight
anchors.right: networkButton.left anchors.right: networkButton.left
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 42.5 anchors.topMargin: 30
anchors.rightMargin: 10 anchors.rightMargin: 10
width: 40 width: 40
height: 42.5 height: 40
z: 200 z: 200
padding: 15 padding: 15
toggled: currentChat.collectionList.length toggled: currentChat.collectionList.length
@ -548,10 +459,9 @@ Window {
MyToolButton { MyToolButton {
id: settingsButton id: settingsButton
backgroundColor: theme.iconBackgroundLight
anchors.right: collectionsButton.left anchors.right: collectionsButton.left
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 42.5 anchors.topMargin: 30
anchors.rightMargin: 10 anchors.rightMargin: 10
width: 40 width: 40
height: 40 height: 40
@ -617,10 +527,9 @@ Window {
MyToolButton { MyToolButton {
id: copyButton id: copyButton
backgroundColor: theme.iconBackgroundLight
anchors.right: settingsButton.left anchors.right: settingsButton.left
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 42.5 anchors.topMargin: 30
anchors.rightMargin: 10 anchors.rightMargin: 10
width: 40 width: 40
height: 40 height: 40
@ -683,10 +592,9 @@ Window {
MyToolButton { MyToolButton {
id: resetContextButton id: resetContextButton
backgroundColor: theme.iconBackgroundLight
anchors.right: copyButton.left anchors.right: copyButton.left
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 42.5 anchors.topMargin: 30
anchors.rightMargin: 10 anchors.rightMargin: 10
width: 40 width: 40
height: 40 height: 40
@ -708,6 +616,7 @@ Window {
id: checkForUpdatesError id: checkForUpdatesError
anchors.centerIn: parent anchors.centerIn: parent
modal: false modal: false
opacity: 0.9
padding: 20 padding: 20
Text { Text {
horizontalAlignment: Text.AlignJustify horizontalAlignment: Text.AlignJustify
@ -718,7 +627,7 @@ Window {
above where this application resides on your filesystem.<br><br> above where this application resides on your filesystem.<br><br>
If you can't start it manually, then I'm afraid you'll have to<br> If you can't start it manually, then I'm afraid you'll have to<br>
reinstall.") reinstall.")
color: theme.textErrorColor color: theme.textColor
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarge
Accessible.role: Accessible.Dialog Accessible.role: Accessible.Dialog
Accessible.name: text Accessible.name: text
@ -726,7 +635,7 @@ Window {
} }
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
color: theme.containerBackground color: theme.backgroundDarkest
border.width: 1 border.width: 1
border.color: theme.dialogBorder border.color: theme.dialogBorder
radius: 10 radius: 10
@ -747,7 +656,7 @@ Window {
ChatDrawer { ChatDrawer {
id: drawer id: drawer
y: header.height + accentRibbon.height y: header.height
width: Math.min(600, 0.3 * window.width) width: Math.min(600, 0.3 * window.width)
height: window.height - y height: window.height - y
onDownloadClicked: { onDownloadClicked: {
@ -769,11 +678,11 @@ Window {
Rectangle { Rectangle {
id: conversation id: conversation
color: theme.conversationBackground color: theme.backgroundLight
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.top: accentRibbon.bottom anchors.top: header.bottom
ScrollView { ScrollView {
id: scrollView id: scrollView
@ -786,129 +695,58 @@ Window {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: currentChat.isServer ? theme.black : theme.conversationBackground color: currentChat.isServer ? theme.backgroundDark : theme.backgroundLight
Rectangle { Text {
id: homePage id: warningLabel
color: "transparent"//theme.green200 text: qsTr("You must install a model to continue. Models are available via the download dialog or you can install them manually by downloading from <a href=\"https://gpt4all.io\">the GPT4All website</a> (look for the Models Explorer) and placing them in the model folder. The model folder can be found in the settings dialog under the application tab.")
anchors.fill: parent color: theme.textColor
visible: (ModelList.installedModels.count === 0 || chatModel.count === 0) && !currentChat.isServer font.pixelSize: theme.fontSizeLarge
width: 600
linkColor: theme.linkColor
wrapMode: Text.WordWrap
anchors.centerIn: parent
visible: ModelList.installedModels.count === 0
onLinkActivated: function(link) {
Qt.openUrlExternally(link)
}
}
ColumnLayout { MyButton {
anchors.centerIn: parent id: downloadButton
spacing: 0 text: qsTr("Download models")
visible: ModelList.installedModels.count === 0
Text { anchors.top: warningLabel.bottom
Layout.alignment: Qt.AlignHCenter anchors.topMargin: 20
text: qsTr("GPT4All") anchors.horizontalCenter: warningLabel.horizontalCenter
color: theme.titleTextColor padding: 15
font.pixelSize: theme.fontSizeLargest + 15 leftPadding: 50
font.bold: true Image {
horizontalAlignment: Qt.AlignHCenter anchors.verticalCenter: parent.verticalCenter
wrapMode: Text.WordWrap anchors.left: parent.left
} anchors.leftMargin: 15
width: 24
Text { height: 24
Layout.alignment: Qt.AlignHCenter mipmap: true
textFormat: Text.StyledText source: "qrc:/gpt4all/icons/download.svg"
text: qsTr( }
"<ul> background: Rectangle {
<li>Run privacy-aware local chatbots. border.color: downloadButton.down ? theme.backgroundLightest : theme.buttonBorder
<li>No internet required to use. border.width: 2
<li>CPU and GPU acceleration. radius: 10
<li>Chat with your local data and documents. color: downloadButton.hovered ? theme.backgroundLighter : theme.backgroundLight
<li>Built by Nomic AI and forever open-source. }
</ul> onClicked: {
") downloadNewModels.open();
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
wrapMode: Text.WordWrap
}
RowLayout {
spacing: 10
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 30
MySlug {
text: "MISTRAL"
color: theme.red600
}
MySlug {
text: "FALCON"
color: theme.green600
}
MySlug {
text: "LLAMA"
color: theme.purple500
}
MySlug {
text: "LLAMA2"
color: theme.red400
}
MySlug {
text: "MPT"
color: theme.green700
}
MySlug {
text: "REPLIT"
color: theme.yellow700
}
MySlug {
text: "STARCODER"
color: theme.purple400
}
MySlug {
text: "SBERT"
color: theme.yellow600
}
MySlug {
text: "GPT-J"
color: theme.gray600
}
}
MyButton {
id: downloadButton
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 40
text: qsTr("Download models")
fontPixelSize: theme.fontSizeLargest + 10
padding: 18
leftPadding: 50
Image {
id: image
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 15
width: 24
height: 24
mipmap: true
source: "qrc:/gpt4all/icons/download.svg"
}
ColorOverlay {
anchors.fill: image
source: image
color: theme.accentColor
}
onClicked: {
downloadNewModels.open();
}
}
} }
} }
ListView { ListView {
id: listView id: listView
visible: ModelList.installedModels.count !== 0 && chatModel.count !== 0 visible: ModelList.installedModels.count !== 0
anchors.fill: parent anchors.fill: parent
model: chatModel model: chatModel
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AlwaysOn }
ScrollBar.vertical: ScrollBar {
parent: listView.parent
anchors.top: listView.top
anchors.left: listView.right
anchors.bottom: listView.bottom
}
Accessible.role: Accessible.List Accessible.role: Accessible.List
Accessible.name: qsTr("Conversation with the model") Accessible.name: qsTr("Conversation with the model")
@ -929,8 +767,8 @@ Window {
background: Rectangle { background: Rectangle {
opacity: 1.0 opacity: 1.0
color: name === qsTr("Response: ") color: name === qsTr("Response: ")
? (currentChat.isServer ? theme.black : theme.lightContrast) ? (currentChat.isServer ? theme.backgroundDarkest : theme.backgroundLighter)
: (currentChat.isServer ? theme.white : theme.darkContrast) : (currentChat.isServer ? theme.backgroundDark : theme.backgroundLight)
} }
TapHandler { TapHandler {
id: tapHandler id: tapHandler
@ -955,7 +793,7 @@ Window {
Component.onCompleted: { Component.onCompleted: {
responseText.setLinkColor(theme.linkColor); responseText.setLinkColor(theme.linkColor);
responseText.setHeaderColor(name === qsTr("Response: ") ? theme.darkContrast : theme.lightContrast); responseText.setHeaderColor(name === qsTr("Response: ") ? theme.backgroundLight : theme.backgroundLighter);
responseText.textDocument = textDocument responseText.textDocument = textDocument
} }
@ -986,7 +824,7 @@ Window {
} }
Label { Label {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: theme.mutedTextColor color: theme.textAccent
text: { text: {
switch (currentChat.responseState) { switch (currentChat.responseState) {
case Chat.ResponseStopped: return qsTr("response stopped ..."); case Chat.ResponseStopped: return qsTr("response stopped ...");
@ -1143,7 +981,6 @@ Window {
MyButton { MyButton {
id: myButton id: myButton
visible: chatModel.count && !currentChat.isServer visible: chatModel.count && !currentChat.isServer
textColor: theme.textColor
Image { Image {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
@ -1173,10 +1010,10 @@ Window {
} }
} }
background: Rectangle { background: Rectangle {
border.color: theme.conversationButtonBorder border.color: myButton.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2 border.width: 2
radius: 10 radius: 10
color: myButton.hovered ? theme.conversationButtonBackgroundHovered : theme.conversationButtonBackground color: myButton.hovered ? theme.backgroundLighter : theme.backgroundLight
} }
anchors.bottom: textInputView.top anchors.bottom: textInputView.top
anchors.horizontalCenter: textInputView.horizontalCenter anchors.horizontalCenter: textInputView.horizontalCenter
@ -1200,13 +1037,12 @@ Window {
RectangularGlow { RectangularGlow {
id: effect id: effect
visible: !currentChat.isServer
anchors.fill: textInputView anchors.fill: textInputView
glowRadius: 50 glowRadius: 50
spread: 0 spread: 0
color: theme.sendGlow color: theme.backgroundDark
cornerRadius: 10 cornerRadius: 10
opacity: 0.1 opacity: 0.2
} }
ScrollView { ScrollView {
@ -1217,7 +1053,7 @@ Window {
anchors.margins: 30 anchors.margins: 30
height: Math.min(contentHeight, 200) height: Math.min(contentHeight, 200)
visible: !currentChat.isServer visible: !currentChat.isServer
MyTextArea { TextArea {
id: textInput id: textInput
color: theme.textColor color: theme.textColor
topPadding: 30 topPadding: 30
@ -1225,8 +1061,14 @@ Window {
leftPadding: 20 leftPadding: 20
rightPadding: 40 rightPadding: 40
enabled: currentChat.isModelLoaded && !currentChat.isServer enabled: currentChat.isModelLoaded && !currentChat.isServer
wrapMode: Text.WordWrap
font.pixelSize: theme.fontSizeLarger font.pixelSize: theme.fontSizeLarger
placeholderText: qsTr("Send a message...") placeholderText: qsTr("Send a message...")
placeholderTextColor: theme.mutedTextColor
background: Rectangle {
color: theme.backgroundAccent
radius: 10
}
Accessible.role: Accessible.EditableText Accessible.role: Accessible.EditableText
Accessible.name: placeholderText Accessible.name: placeholderText
Accessible.description: qsTr("Send messages/prompts to the model") Accessible.description: qsTr("Send messages/prompts to the model")
@ -1259,8 +1101,6 @@ Window {
} }
MyToolButton { MyToolButton {
backgroundColor: theme.sendButtonBackground
backgroundColorHovered: theme.sendButtonBackgroundHovered
anchors.right: textInputView.right anchors.right: textInputView.right
anchors.verticalCenter: textInputView.verticalCenter anchors.verticalCenter: textInputView.verticalCenter
anchors.rightMargin: 15 anchors.rightMargin: 15

View File

@ -11,6 +11,7 @@ MyDialog {
id: abpoutDialog id: abpoutDialog
anchors.centerIn: parent anchors.centerIn: parent
modal: false modal: false
opacity: 0.9
padding: 20 padding: 20
width: 1024 width: 1024
height: column.height + 40 height: column.height + 40
@ -38,9 +39,8 @@ MyDialog {
anchors.leftMargin: 30 anchors.leftMargin: 30
anchors.verticalCenter: img.verticalCenter anchors.verticalCenter: img.verticalCenter
text: qsTr("About GPT4All") text: qsTr("About GPT4All")
font.pixelSize: theme.fontSizeLarger
color: theme.textColor color: theme.textColor
font.pixelSize: theme.fontSizeLarge
font.bold: true
} }
} }
@ -51,23 +51,31 @@ MyDialog {
ScrollBar.vertical.policy: ScrollBar.AlwaysOn ScrollBar.vertical.policy: ScrollBar.AlwaysOn
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
MyTextArea { TextArea {
id: welcome id: welcome
wrapMode: Text.Wrap
width: 1024 - 40 width: 1024 - 40
padding: 20
textFormat: TextEdit.MarkdownText textFormat: TextEdit.MarkdownText
text: qsTr("### Release notes\n") text: qsTr("### Release notes\n")
+ Download.releaseInfo.notes + Download.releaseInfo.notes
+ qsTr("### Contributors\n") + qsTr("### Contributors\n")
+ Download.releaseInfo.contributors + Download.releaseInfo.contributors
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
focus: false focus: false
readOnly: true readOnly: true
Accessible.role: Accessible.Paragraph Accessible.role: Accessible.Paragraph
Accessible.name: qsTr("Release notes") Accessible.name: qsTr("Release notes")
Accessible.description: qsTr("Release notes for this version") Accessible.description: qsTr("Release notes for this version")
background: Rectangle {
color: theme.backgroundLight
radius: 10
}
} }
} }
MySettingsLabel { Label {
id: discordLink id: discordLink
width: parent.width width: parent.width
textFormat: Text.StyledText textFormat: Text.StyledText
@ -82,7 +90,7 @@ MyDialog {
Accessible.name: qsTr("Discord link") Accessible.name: qsTr("Discord link")
} }
MySettingsLabel { Label {
id: nomicProps id: nomicProps
width: parent.width width: parent.width
textFormat: Text.StyledText textFormat: Text.StyledText

View File

@ -18,9 +18,11 @@ MySettingsTab {
columns: 3 columns: 3
rowSpacing: 10 rowSpacing: 10
columnSpacing: 10 columnSpacing: 10
MySettingsLabel { Label {
id: themeLabel id: themeLabel
text: qsTr("Theme") text: qsTr("Theme:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 1 Layout.row: 1
Layout.column: 0 Layout.column: 0
} }
@ -29,9 +31,9 @@ MySettingsTab {
Layout.row: 1 Layout.row: 1
Layout.column: 1 Layout.column: 1
Layout.columnSpan: 1 Layout.columnSpan: 1
Layout.minimumWidth: 200 Layout.minimumWidth: 50
Layout.fillWidth: false Layout.fillWidth: false
model: ["Dark", "Light", "LegacyDark"] model: ["Dark", "Light"]
Accessible.role: Accessible.ComboBox Accessible.role: Accessible.ComboBox
Accessible.name: qsTr("Color theme") Accessible.name: qsTr("Color theme")
Accessible.description: qsTr("Color theme for the chat client to use") Accessible.description: qsTr("Color theme for the chat client to use")
@ -51,9 +53,11 @@ MySettingsTab {
MySettings.chatTheme = themeBox.currentText MySettings.chatTheme = themeBox.currentText
} }
} }
MySettingsLabel { Label {
id: fontLabel id: fontLabel
text: qsTr("Font Size") text: qsTr("Font Size:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 2 Layout.row: 2
Layout.column: 0 Layout.column: 0
} }
@ -84,9 +88,11 @@ MySettingsTab {
MySettings.fontSize = fontBox.currentText MySettings.fontSize = fontBox.currentText
} }
} }
MySettingsLabel { Label {
id: deviceLabel id: deviceLabel
text: qsTr("Device") text: qsTr("Device:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 3 Layout.row: 3
Layout.column: 0 Layout.column: 0
} }
@ -120,9 +126,11 @@ MySettingsTab {
MySettings.device = deviceBox.currentText MySettings.device = deviceBox.currentText
} }
} }
MySettingsLabel { Label {
id: defaultModelLabel id: defaultModelLabel
text: qsTr("Default model") text: qsTr("Default model:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 4 Layout.row: 4
Layout.column: 0 Layout.column: 0
} }
@ -153,9 +161,11 @@ MySettingsTab {
MySettings.userDefaultModel = comboBox.currentText MySettings.userDefaultModel = comboBox.currentText
} }
} }
MySettingsLabel { Label {
id: modelPathLabel id: modelPathLabel
text: qsTr("Download path") text: qsTr("Download path:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 5 Layout.row: 5
Layout.column: 0 Layout.column: 0
} }
@ -180,7 +190,7 @@ MySettingsTab {
} }
} }
} }
MySettingsButton { MyButton {
Layout.row: 5 Layout.row: 5
Layout.column: 2 Layout.column: 2
text: qsTr("Browse") text: qsTr("Browse")
@ -191,9 +201,11 @@ MySettingsTab {
}) })
} }
} }
MySettingsLabel { Label {
id: nThreadsLabel id: nThreadsLabel
text: qsTr("CPU Threads") text: qsTr("CPU Threads:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 6 Layout.row: 6
Layout.column: 0 Layout.column: 0
} }
@ -221,9 +233,11 @@ MySettingsTab {
Accessible.name: nThreadsLabel.text Accessible.name: nThreadsLabel.text
Accessible.description: ToolTip.text Accessible.description: ToolTip.text
} }
MySettingsLabel { Label {
id: saveChatsContextLabel id: saveChatsContextLabel
text: qsTr("Save chats context to disk") text: qsTr("Save chats context to disk:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 7 Layout.row: 7
Layout.column: 0 Layout.column: 0
} }
@ -238,9 +252,11 @@ MySettingsTab {
ToolTip.text: qsTr("WARNING: Saving chats to disk can be ~2GB per chat") ToolTip.text: qsTr("WARNING: Saving chats to disk can be ~2GB per chat")
ToolTip.visible: hovered ToolTip.visible: hovered
} }
MySettingsLabel { Label {
id: serverChatLabel id: serverChatLabel
text: qsTr("Enable API server") text: qsTr("Enable API server:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 8 Layout.row: 8
Layout.column: 0 Layout.column: 0
} }
@ -260,8 +276,8 @@ MySettingsTab {
Layout.column: 0 Layout.column: 0
Layout.columnSpan: 3 Layout.columnSpan: 3
Layout.fillWidth: true Layout.fillWidth: true
height: 3 height: 1
color: theme.accentColor color: theme.tabBorder
} }
} }
advancedSettings: GridLayout { advancedSettings: GridLayout {
@ -273,12 +289,14 @@ MySettingsTab {
Layout.column: 0 Layout.column: 0
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 3 Layout.columnSpan: 3
height: 3 height: 1
color: theme.accentColor color: theme.tabBorder
} }
MySettingsLabel { Label {
id: gpuOverrideLabel id: gpuOverrideLabel
text: qsTr("Force Metal (macOS+arm)") text: qsTr("Force Metal (macOS+arm):")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 1 Layout.row: 1
Layout.column: 0 Layout.column: 0
} }
@ -298,7 +316,7 @@ MySettingsTab {
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
Layout.minimumHeight: warningLabel.height Layout.minimumHeight: warningLabel.height
MySettingsLabel { Label {
id: warningLabel id: warningLabel
width: parent.width width: parent.width
color: theme.textErrorColor color: theme.textErrorColor

View File

@ -12,6 +12,7 @@ import mysettings
Drawer { Drawer {
id: chatDrawer id: chatDrawer
modal: false modal: false
opacity: 0.9
Theme { Theme {
id: theme id: theme
@ -22,7 +23,7 @@ Drawer {
background: Rectangle { background: Rectangle {
height: parent.height height: parent.height
color: theme.containerBackground color: theme.backgroundDarkest
} }
Item { Item {
@ -42,6 +43,12 @@ Drawer {
bottomPadding: 20 bottomPadding: 20
text: qsTr("\uFF0B New chat") text: qsTr("\uFF0B New chat")
Accessible.description: qsTr("Create a new chat") Accessible.description: qsTr("Create a new chat")
background: Rectangle {
border.color: newChat.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2
radius: 10
color: newChat.hovered ? theme.backgroundDark : theme.backgroundDarkest
}
onClicked: { onClicked: {
ChatListModel.addChat(); ChatListModel.addChat();
Network.sendNewChat(ChatListModel.count) Network.sendNewChat(ChatListModel.count)
@ -64,23 +71,19 @@ Drawer {
anchors.fill: parent anchors.fill: parent
anchors.rightMargin: 10 anchors.rightMargin: 10
model: ChatListModel model: ChatListModel
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar { policy: ScrollBar.AlwaysOn }
parent: conversationList.parent
anchors.top: conversationList.top
anchors.left: conversationList.right
anchors.bottom: conversationList.bottom
}
delegate: Rectangle { delegate: Rectangle {
id: chatRectangle id: chatRectangle
width: conversationList.width width: conversationList.width
height: chatName.height height: chatName.height
opacity: 0.9
property bool isCurrent: ChatListModel.currentChat === ChatListModel.get(index) property bool isCurrent: ChatListModel.currentChat === ChatListModel.get(index)
property bool isServer: ChatListModel.get(index) && ChatListModel.get(index).isServer property bool isServer: ChatListModel.get(index) && ChatListModel.get(index).isServer
property bool trashQuestionDisplayed: false property bool trashQuestionDisplayed: false
visible: !isServer || MySettings.serverChat visible: !isServer || MySettings.serverChat
z: isCurrent ? 199 : 1 z: isCurrent ? 199 : 1
color: index % 2 === 0 ? theme.darkContrast : theme.lightContrast color: isServer ? theme.backgroundDarkest : (index % 2 === 0 ? theme.backgroundLight : theme.backgroundLighter)
border.width: isCurrent border.width: isCurrent
border.color: chatName.readOnly ? theme.assistantColor : theme.userColor border.color: chatName.readOnly ? theme.assistantColor : theme.userColor
TextField { TextField {
@ -103,7 +106,7 @@ Drawer {
font: chatName.font font: chatName.font
text: name text: name
elide: Text.ElideRight elide: Text.ElideRight
elideWidth: chatName.width - 40 elideWidth: chatName.width - 25
} }
background: Rectangle { background: Rectangle {
color: "transparent" color: "transparent"

View File

@ -22,10 +22,9 @@ MyDialog {
id: listLabel id: listLabel
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
text: qsTr("Local Documents") text: qsTr("Local Documents:")
color: theme.titleTextColor
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarge
font.bold: true color: theme.textColor
} }
ScrollView { ScrollView {
@ -38,28 +37,21 @@ MyDialog {
anchors.right: parent.right anchors.right: parent.right
clip: true clip: true
contentHeight: 300 contentHeight: 300
ScrollBar.vertical.policy: ScrollBar.AlwaysOff ScrollBar.vertical.policy: ScrollBar.AlwaysOn
background: Rectangle { background: Rectangle {
color: theme.controlBackground color: theme.backgroundLighter
} }
ListView { ListView {
id: listView id: listView
model: LocalDocs.localDocsModel model: LocalDocs.localDocsModel
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar {
parent: listView.parent
anchors.top: listView.top
anchors.left: listView.right
anchors.bottom: listView.bottom
}
delegate: Rectangle { delegate: Rectangle {
id: item id: item
width: listView.width width: listView.width
height: collectionId.height + 40 height: collectionId.height + 40
color: index % 2 === 0 ? theme.darkContrast : theme.lightContrast color: index % 2 === 0 ? theme.backgroundLight : theme.backgroundLighter
MyCheckBox { MyCheckBox {
id: checkBox id: checkBox
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -98,7 +90,7 @@ MyDialog {
value: (model.totalBytesToIndex - model.currentBytesToIndex) / model.totalBytesToIndex value: (model.totalBytesToIndex - model.currentBytesToIndex) / model.totalBytesToIndex
background: Rectangle { background: Rectangle {
implicitHeight: 45 implicitHeight: 45
color: theme.progressBackground color: theme.backgroundDarkest
radius: 3 radius: 3
} }
contentItem: Item { contentItem: Item {
@ -108,7 +100,7 @@ MyDialog {
width: itemProgressBar.visualPosition * parent.width width: itemProgressBar.visualPosition * parent.width
height: parent.height height: parent.height
radius: 2 radius: 2
color: theme.progressForeground color: theme.assistantColor
} }
} }
Accessible.role: Accessible.ProgressBar Accessible.role: Accessible.ProgressBar
@ -131,7 +123,7 @@ MyDialog {
} }
} }
MySettingsButton { MyButton {
id: collectionSettings id: collectionSettings
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -26,7 +26,7 @@ MySettingsTab {
property alias collection: collection.text property alias collection: collection.text
property alias folder_path: folderEdit.text property alias folder_path: folderEdit.text
MySettingsLabel { Label {
id: downloadLabel id: downloadLabel
Layout.fillWidth: true Layout.fillWidth: true
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
@ -34,9 +34,11 @@ MySettingsTab {
visible: !hasEmbeddingModel visible: !hasEmbeddingModel
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
text: qsTr("This feature requires the download of a text embedding model in order to index documents for later search. Please download the <b>SBert</a> text embedding model from the download dialog to proceed.") text: qsTr("This feature requires the download of a text embedding model in order to index documents for later search. Please download the <b>SBert</a> text embedding model from the download dialog to proceed.")
font.pixelSize: theme.fontSizeLarger
color: theme.textColor
} }
MySettingsButton { MyButton {
visible: !hasEmbeddingModel visible: !hasEmbeddingModel
Layout.topMargin: 20 Layout.topMargin: 20
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
@ -95,7 +97,7 @@ MySettingsTab {
} }
} }
MySettingsButton { MyButton {
id: browseButton id: browseButton
text: qsTr("Browse") text: qsTr("Browse")
onClicked: { onClicked: {
@ -105,7 +107,7 @@ MySettingsTab {
} }
} }
MySettingsButton { MyButton {
id: addButton id: addButton
text: qsTr("Add") text: qsTr("Add")
Accessible.role: Accessible.Button Accessible.role: Accessible.Button
@ -141,7 +143,7 @@ MySettingsTab {
id: item id: item
Layout.fillWidth: true Layout.fillWidth: true
height: buttons.height + 20 height: buttons.height + 20
color: index % 2 === 0 ? theme.darkContrast : theme.lightContrast color: index % 2 === 0 ? theme.backgroundDark : theme.backgroundDarker
property bool removing: false property bool removing: false
Text { Text {
@ -175,7 +177,7 @@ MySettingsTab {
anchors.margins: 20 anchors.margins: 20
width: removeButton.width width: removeButton.width
height:removeButton.height height:removeButton.height
MySettingsButton { MyButton {
id: removeButton id: removeButton
anchors.centerIn: parent anchors.centerIn: parent
text: qsTr("Remove") text: qsTr("Remove")
@ -192,9 +194,11 @@ MySettingsTab {
RowLayout { RowLayout {
visible: hasEmbeddingModel visible: hasEmbeddingModel
MySettingsLabel { Label {
id: showReferencesLabel id: showReferencesLabel
text: qsTr("Show references") text: qsTr("Show references:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
} }
MyCheckBox { MyCheckBox {
id: showReferencesBox id: showReferencesBox
@ -210,8 +214,8 @@ MySettingsTab {
Rectangle { Rectangle {
visible: hasEmbeddingModel visible: hasEmbeddingModel
Layout.fillWidth: true Layout.fillWidth: true
height: 3 height: 1
color: theme.accentColor color: theme.tabBorder
} }
} }
advancedSettings: GridLayout { advancedSettings: GridLayout {
@ -226,15 +230,17 @@ MySettingsTab {
Layout.column: 0 Layout.column: 0
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 3 Layout.columnSpan: 3
height: 3 height: 1
color: theme.accentColor color: theme.tabBorder
} }
MySettingsLabel { Label {
id: chunkLabel id: chunkLabel
Layout.row: 1 Layout.row: 1
Layout.column: 0 Layout.column: 0
text: qsTr("Document snippet size (characters)") color: theme.textColor
font.pixelSize: theme.fontSizeLarge
text: qsTr("Document snippet size (characters):")
} }
MyTextField { MyTextField {
@ -258,11 +264,13 @@ MySettingsTab {
} }
} }
MySettingsLabel { Label {
id: contextItemsPerPrompt id: contextItemsPerPrompt
Layout.row: 2 Layout.row: 2
Layout.column: 0 Layout.column: 0
text: qsTr("Max document snippets per prompt") color: theme.textColor
font.pixelSize: theme.fontSizeLarge
text: qsTr("Max document snippets per prompt:")
} }
MyTextField { MyTextField {
@ -292,7 +300,7 @@ MySettingsTab {
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
Layout.minimumHeight: warningLabel.height Layout.minimumHeight: warningLabel.height
MySettingsLabel { Label {
id: warningLabel id: warningLabel
width: parent.width width: parent.width
color: theme.textErrorColor color: theme.textErrorColor

View File

@ -41,17 +41,11 @@ MyDialog {
Label { Label {
id: listLabel id: listLabel
text: qsTr("Available Models") text: qsTr("Available Models:")
visible: false font.pixelSize: theme.fontSizeLarge
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true Layout.fillWidth: true
color: theme.titleTextColor color: theme.textColor
font.pixelSize: theme.fontSizeLarge
font.bold: true
}
Item {
height: 0 // for visible space between close button and rest of dialog
} }
Label { Label {
@ -90,7 +84,7 @@ MyDialog {
id: delegateItem id: delegateItem
width: modelListView.width width: modelListView.width
height: childrenRect.height height: childrenRect.height
color: index % 2 === 0 ? theme.darkContrast : theme.lightContrast color: index % 2 === 0 ? theme.backgroundLight : theme.backgroundLighter
GridLayout { GridLayout {
columns: 2 columns: 2
@ -105,7 +99,7 @@ MyDialog {
Layout.topMargin: 20 Layout.topMargin: 20
Layout.leftMargin: 20 Layout.leftMargin: 20
Layout.columnSpan: 2 Layout.columnSpan: 2
color: theme.titleTextColor color: theme.assistantColor
Accessible.role: Accessible.Paragraph Accessible.role: Accessible.Paragraph
Accessible.name: qsTr("Model file") Accessible.name: qsTr("Model file")
Accessible.description: qsTr("Model file to be downloaded") Accessible.description: qsTr("Model file to be downloaded")
@ -114,8 +108,7 @@ MyDialog {
Rectangle { Rectangle {
id: actionBox id: actionBox
width: childrenRect.width + 20 width: childrenRect.width + 20
color: theme.containerBackground color: theme.backgroundDark
border.color: theme.accentColor
border.width: 1 border.width: 1
radius: 10 radius: 10
Layout.row: 1 Layout.row: 1
@ -129,7 +122,7 @@ MyDialog {
ColumnLayout { ColumnLayout {
spacing: 0 spacing: 0
MySettingsButton { MyButton {
id: downloadButton id: downloadButton
text: isDownloading ? qsTr("Cancel") : isIncomplete ? qsTr("Resume") : qsTr("Download") text: isDownloading ? qsTr("Cancel") : isIncomplete ? qsTr("Resume") : qsTr("Download")
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarge
@ -140,6 +133,12 @@ MyDialog {
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
visible: !isChatGPT && !installed && !calcHash && downloadError === "" visible: !isChatGPT && !installed && !calcHash && downloadError === ""
Accessible.description: qsTr("Stop/restart/start the download") Accessible.description: qsTr("Stop/restart/start the download")
background: Rectangle {
border.color: downloadButton.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2
radius: 10
color: downloadButton.hovered ? theme.backgroundDark : theme.backgroundDarkest
}
onClicked: { onClicked: {
if (!isDownloading) { if (!isDownloading) {
Download.downloadModel(filename); Download.downloadModel(filename);
@ -149,9 +148,10 @@ MyDialog {
} }
} }
MySettingsDestructiveButton { MyButton {
id: removeButton id: removeButton
text: qsTr("Remove") text: qsTr("Remove")
font.pixelSize: theme.fontSizeLarge
Layout.topMargin: 20 Layout.topMargin: 20
Layout.leftMargin: 20 Layout.leftMargin: 20
Layout.minimumWidth: openaiKey.width Layout.minimumWidth: openaiKey.width
@ -159,12 +159,18 @@ MyDialog {
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
visible: installed || downloadError !== "" visible: installed || downloadError !== ""
Accessible.description: qsTr("Remove model from filesystem") Accessible.description: qsTr("Remove model from filesystem")
background: Rectangle {
border.color: removeButton.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2
radius: 10
color: removeButton.hovered ? theme.backgroundDark : theme.backgroundDarkest
}
onClicked: { onClicked: {
Download.removeModel(filename); Download.removeModel(filename);
} }
} }
MySettingsButton { MyButton {
id: installButton id: installButton
visible: !installed && isChatGPT visible: !installed && isChatGPT
Layout.topMargin: 20 Layout.topMargin: 20
@ -174,6 +180,12 @@ MyDialog {
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
text: qsTr("Install") text: qsTr("Install")
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarge
background: Rectangle {
border.color: installButton.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2
radius: 10
color: installButton.hovered ? theme.backgroundDark : theme.backgroundDarkest
}
onClicked: { onClicked: {
if (openaiKey.text === "") if (openaiKey.text === "")
openaiKey.showError(); openaiKey.showError();
@ -273,7 +285,7 @@ MyDialog {
value: bytesReceived / bytesTotal value: bytesReceived / bytesTotal
background: Rectangle { background: Rectangle {
implicitHeight: 45 implicitHeight: 45
color: theme.progressBackground color: theme.backgroundDarkest
radius: 3 radius: 3
} }
contentItem: Item { contentItem: Item {
@ -283,7 +295,7 @@ MyDialog {
width: itemProgressBar.visualPosition * parent.width width: itemProgressBar.visualPosition * parent.width
height: parent.height height: parent.height
radius: 2 radius: 2
color: theme.progressForeground color: theme.assistantColor
} }
} }
Accessible.role: Accessible.ProgressBar Accessible.role: Accessible.ProgressBar
@ -338,14 +350,21 @@ MyDialog {
Layout.minimumWidth: 150 Layout.minimumWidth: 150
Layout.maximumWidth: textMetrics.width + 25 Layout.maximumWidth: textMetrics.width + 25
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
color: theme.textColor
background: Rectangle {
color: theme.backgroundLighter
radius: 10
}
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
function showError() { function showError() {
openaiKey.placeholderTextColor = theme.textErrorColor openaiKey.placeholderTextColor = theme.textErrorColor
} }
onTextChanged: { onTextChanged: {
openaiKey.placeholderTextColor = theme.mutedTextColor openaiKey.placeholderTextColor = theme.backgroundLightest
} }
placeholderText: qsTr("enter $OPENAI_API_KEY") placeholderText: qsTr("enter $OPENAI_API_KEY")
font.pixelSize: theme.fontSizeLarge
placeholderTextColor: theme.backgroundLightest
Accessible.role: Accessible.EditableText Accessible.role: Accessible.EditableText
Accessible.name: placeholderText Accessible.name: placeholderText
Accessible.description: qsTr("Whether the file hash is being calculated") Accessible.description: qsTr("Whether the file hash is being calculated")
@ -383,12 +402,18 @@ MyDialog {
Rectangle { Rectangle {
width: modelListView.width width: modelListView.width
height: expandButton.height + 80 height: expandButton.height + 80
color: ModelList.downloadableModels.count % 2 === 0 ? theme.darkContrast : theme.lightContrast color: ModelList.downloadableModels.count % 2 === 0 ? theme.backgroundLight : theme.backgroundLighter
MySettingsButton { MyButton {
id: expandButton id: expandButton
anchors.centerIn: parent anchors.centerIn: parent
padding: 40 padding: 40
text: ModelList.downloadableModels.expanded ? qsTr("Show fewer models") : qsTr("Show more models") text: ModelList.downloadableModels.expanded ? qsTr("Show fewer models") : qsTr("Show more models")
background: Rectangle {
border.color: expandButton.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2
radius: 10
color: expandButton.hovered ? theme.backgroundDark : theme.backgroundDarkest
}
onClicked: { onClicked: {
ModelList.downloadableModels.expanded = !ModelList.downloadableModels.expanded; ModelList.downloadableModels.expanded = !ModelList.downloadableModels.expanded;
} }
@ -410,9 +435,9 @@ MyDialog {
MySettings.modelPath = selectedFolder MySettings.modelPath = selectedFolder
} }
} }
MySettingsLabel { Label {
id: modelPathLabel id: modelPathLabel
text: qsTr("Download path") text: qsTr("Download path:")
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarge
color: theme.textColor color: theme.textColor
Layout.row: 1 Layout.row: 1
@ -436,7 +461,7 @@ MyDialog {
} }
} }
} }
MySettingsButton { MyButton {
text: qsTr("Browse") text: qsTr("Browse")
Accessible.description: qsTr("Choose where to save model files") Accessible.description: qsTr("Choose where to save model files")
onClicked: modelPathDialog.open() onClicked: modelPathDialog.open()

View File

@ -21,11 +21,13 @@ MySettingsTab {
property var currentModelId: comboBox.currentValue property var currentModelId: comboBox.currentValue
property var currentModelInfo: ModelList.modelInfo(root.currentModelId) property var currentModelInfo: ModelList.modelInfo(root.currentModelId)
MySettingsLabel { Label {
id: label id: label
Layout.row: 0 Layout.row: 0
Layout.column: 0 Layout.column: 0
text: qsTr("Model/Character") text: qsTr("Model/Character:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
} }
RowLayout { RowLayout {
@ -62,13 +64,13 @@ MySettingsTab {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
background: Rectangle { background: Rectangle {
color: highlighted ? theme.lightContrast : theme.darkContrast color: highlighted ? theme.backgroundLight : theme.backgroundDark
} }
highlighted: comboBox.highlightedIndex === index highlighted: comboBox.highlightedIndex === index
} }
} }
MySettingsButton { MyButton {
id: cloneButton id: cloneButton
text: qsTr("Clone") text: qsTr("Clone")
onClicked: { onClicked: {
@ -77,7 +79,7 @@ MySettingsTab {
} }
} }
MySettingsDestructiveButton { MyButton {
id: removeButton id: removeButton
enabled: root.currentModelInfo.isClone enabled: root.currentModelInfo.isClone
text: qsTr("Remove") text: qsTr("Remove")
@ -93,15 +95,18 @@ MySettingsTab {
Layout.column: 0 Layout.column: 0
Layout.topMargin: 15 Layout.topMargin: 15
spacing: 10 spacing: 10
MySettingsLabel { Label {
id: uniqueNameLabel id: uniqueNameLabel
text: qsTr("Unique Name") text: qsTr("Unique Name:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
} }
MySettingsLabel { Label {
id: uniqueNameLabelHelp id: uniqueNameLabelHelp
visible: false visible: false
text: qsTr("Must contain a non-empty unique name that does not match any existing model/character.") text: qsTr("Must contain a non-empty unique name that does not match any existing model/character.")
color: theme.textErrorColor color: theme.textErrorColor
font.pixelSize: theme.fontSizeLarge
wrapMode: TextArea.Wrap wrapMode: TextArea.Wrap
} }
} }
@ -111,6 +116,7 @@ MySettingsTab {
text: root.currentModelName text: root.currentModelName
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarge
enabled: root.currentModelInfo.isClone || root.currentModelInfo.description === "" enabled: root.currentModelInfo.isClone || root.currentModelInfo.description === ""
color: enabled ? theme.textColor : theme.mutedTextColor
Layout.row: 3 Layout.row: 3
Layout.column: 0 Layout.column: 0
Layout.columnSpan: 2 Layout.columnSpan: 2
@ -136,8 +142,10 @@ MySettingsTab {
} }
} }
MySettingsLabel { Label {
text: qsTr("Model File") text: qsTr("Model File:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 4 Layout.row: 4
Layout.column: 0 Layout.column: 0
Layout.topMargin: 15 Layout.topMargin: 15
@ -147,15 +155,18 @@ MySettingsTab {
text: root.currentModelInfo.filename text: root.currentModelInfo.filename
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarge
enabled: false enabled: false
color: enabled ? theme.textColor : theme.mutedTextColor
Layout.row: 5 Layout.row: 5
Layout.column: 0 Layout.column: 0
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
} }
MySettingsLabel { Label {
visible: !root.currentModelInfo.isChatGPT visible: !root.currentModelInfo.isChatGPT
text: qsTr("System Prompt") text: qsTr("System Prompt:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 6 Layout.row: 6
Layout.column: 0 Layout.column: 0
Layout.topMargin: 15 Layout.topMargin: 15
@ -170,10 +181,18 @@ MySettingsTab {
Layout.fillWidth: true Layout.fillWidth: true
color: "transparent" color: "transparent"
Layout.minimumHeight: Math.max(100, systemPromptArea.contentHeight + 20) Layout.minimumHeight: Math.max(100, systemPromptArea.contentHeight + 20)
MyTextArea { TextArea {
id: systemPromptArea id: systemPromptArea
anchors.fill: parent anchors.fill: parent
text: root.currentModelInfo.systemPrompt text: root.currentModelInfo.systemPrompt
color: theme.textColor
background: Rectangle {
implicitWidth: 150
color: theme.backgroundDark
radius: 10
}
padding: 10
wrapMode: TextArea.Wrap
Connections { Connections {
target: MySettings target: MySettings
function onSystemPromptChanged() { function onSystemPromptChanged() {
@ -189,10 +208,10 @@ MySettingsTab {
onTextChanged: { onTextChanged: {
MySettings.setModelSystemPrompt(root.currentModelInfo, text) MySettings.setModelSystemPrompt(root.currentModelInfo, text)
} }
bottomPadding: 10
Accessible.role: Accessible.EditableText Accessible.role: Accessible.EditableText
ToolTip.text: qsTr("The systemPrompt allows instructions to the model at the beginning of a chat.\nNOTE: A longer, detailed system prompt can lead to higher quality answers, but can also slow down generation.") ToolTip.text: qsTr("The systemPrompt allows instructions to the model at the beginning of a chat.\nNOTE: A longer, detailed system prompt can lead to higher quality answers, but can also slow down generation.")
ToolTip.visible: hovered ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
} }
} }
@ -202,14 +221,17 @@ MySettingsTab {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.topMargin: 15 Layout.topMargin: 15
spacing: 10 spacing: 10
MySettingsLabel { Label {
id: promptTemplateLabel id: promptTemplateLabel
text: qsTr("Prompt Template") text: qsTr("Prompt Template:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
} }
MySettingsLabel { Label {
id: promptTemplateLabelHelp id: promptTemplateLabelHelp
text: qsTr("Must contain the string \"%1\" to be replaced with the user's input.") text: qsTr("Must contain the string \"%1\" to be replaced with the user's input.")
color: theme.textErrorColor color: theme.textErrorColor
font.pixelSize: theme.fontSizeLarge
visible: templateTextArea.text.indexOf("%1") === -1 visible: templateTextArea.text.indexOf("%1") === -1
wrapMode: TextArea.Wrap wrapMode: TextArea.Wrap
} }
@ -224,10 +246,19 @@ MySettingsTab {
Layout.minimumHeight: Math.max(100, templateTextArea.contentHeight + 20) Layout.minimumHeight: Math.max(100, templateTextArea.contentHeight + 20)
color: "transparent" color: "transparent"
clip: true clip: true
MyTextArea { TextArea {
id: templateTextArea id: templateTextArea
anchors.fill: parent anchors.fill: parent
text: root.currentModelInfo.promptTemplate text: root.currentModelInfo.promptTemplate
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
background: Rectangle {
implicitWidth: 150
color: theme.backgroundDark
radius: 10
}
padding: 10
wrapMode: TextArea.Wrap
Connections { Connections {
target: MySettings target: MySettings
function onPromptTemplateChanged() { function onPromptTemplateChanged() {
@ -245,12 +276,12 @@ MySettingsTab {
MySettings.setModelPromptTemplate(root.currentModelInfo, text) MySettings.setModelPromptTemplate(root.currentModelInfo, text)
} }
} }
bottomPadding: 10
Accessible.role: Accessible.EditableText Accessible.role: Accessible.EditableText
Accessible.name: promptTemplateLabel.text Accessible.name: promptTemplateLabel.text
Accessible.description: promptTemplateLabelHelp.text Accessible.description: promptTemplateLabelHelp.text
ToolTip.text: qsTr("The prompt template partially determines how models will respond to prompts.\nNOTE: A longer, detailed template can lead to higher quality answers, but can also slow down generation.") ToolTip.text: qsTr("The prompt template partially determines how models will respond to prompts.\nNOTE: A longer, detailed template can lead to higher quality answers, but can also slow down generation.")
ToolTip.visible: hovered ToolTip.visible: hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
} }
} }
@ -267,6 +298,8 @@ MySettingsTab {
Layout.bottomMargin: 35 Layout.bottomMargin: 35
Layout.leftMargin: 35 Layout.leftMargin: 35
width: 3000 width: 3000
border.width: 1
border.color: theme.tabBorder
radius: 10 radius: 10
color: "transparent" color: "transparent"
Item { Item {
@ -291,8 +324,9 @@ MySettingsTab {
} }
} }
MySettingsLabel { Label {
text: qsTr("Generation Settings") text: qsTr("Generation Settings")
color: theme.textColor
Layout.row: 10 Layout.row: 10
Layout.column: 0 Layout.column: 0
Layout.columnSpan: 2 Layout.columnSpan: 2
@ -300,7 +334,7 @@ MySettingsTab {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.minimumWidth: promptTemplate.width Layout.minimumWidth: promptTemplate.width
horizontalAlignment: Qt.AlignHCenter horizontalAlignment: Qt.AlignHCenter
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarger
font.bold: true font.bold: true
} }
@ -315,10 +349,12 @@ MySettingsTab {
rowSpacing: 10 rowSpacing: 10
columnSpacing: 10 columnSpacing: 10
MySettingsLabel { Label {
id: contextLengthLabel id: contextLengthLabel
visible: !root.currentModelInfo.isChatGPT visible: !root.currentModelInfo.isChatGPT
text: qsTr("Context Length") text: qsTr("Context Length:")
font.pixelSize: theme.fontSizeLarge
color: theme.textColor
Layout.row: 0 Layout.row: 0
Layout.column: 0 Layout.column: 0
} }
@ -326,8 +362,8 @@ MySettingsTab {
id: contextLengthField id: contextLengthField
visible: !root.currentModelInfo.isChatGPT visible: !root.currentModelInfo.isChatGPT
text: root.currentModelInfo.contextLength text: root.currentModelInfo.contextLength
font.pixelSize: theme.fontSizeLarge
color: theme.textColor color: theme.textColor
font.pixelSize: theme.fontSizeLarge
ToolTip.text: qsTr("Maximum combined prompt/response tokens before information is lost.\nUsing more context than the model was trained on will yield poor results.\nNOTE: Does not take effect until you RESTART GPT4All or SWITCH MODELS.") ToolTip.text: qsTr("Maximum combined prompt/response tokens before information is lost.\nUsing more context than the model was trained on will yield poor results.\nNOTE: Does not take effect until you RESTART GPT4All or SWITCH MODELS.")
ToolTip.visible: hovered ToolTip.visible: hovered
Layout.row: 0 Layout.row: 0
@ -361,9 +397,11 @@ MySettingsTab {
Accessible.description: ToolTip.text Accessible.description: ToolTip.text
} }
MySettingsLabel { Label {
id: tempLabel id: tempLabel
text: qsTr("Temperature") text: qsTr("Temperature:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 1 Layout.row: 1
Layout.column: 2 Layout.column: 2
} }
@ -371,8 +409,8 @@ MySettingsTab {
MyTextField { MyTextField {
id: temperatureField id: temperatureField
text: root.currentModelInfo.temperature text: root.currentModelInfo.temperature
font.pixelSize: theme.fontSizeLarge
color: theme.textColor color: theme.textColor
font.pixelSize: theme.fontSizeLarge
ToolTip.text: qsTr("Temperature increases the chances of choosing less likely tokens.\nNOTE: Higher temperature gives more creative but less predictable outputs.") ToolTip.text: qsTr("Temperature increases the chances of choosing less likely tokens.\nNOTE: Higher temperature gives more creative but less predictable outputs.")
ToolTip.visible: hovered ToolTip.visible: hovered
Layout.row: 1 Layout.row: 1
@ -405,9 +443,11 @@ MySettingsTab {
Accessible.name: tempLabel.text Accessible.name: tempLabel.text
Accessible.description: ToolTip.text Accessible.description: ToolTip.text
} }
MySettingsLabel { Label {
id: topPLabel id: topPLabel
text: qsTr("Top P") text: qsTr("Top P:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 2 Layout.row: 2
Layout.column: 0 Layout.column: 0
} }
@ -448,10 +488,12 @@ MySettingsTab {
Accessible.name: topPLabel.text Accessible.name: topPLabel.text
Accessible.description: ToolTip.text Accessible.description: ToolTip.text
} }
MySettingsLabel { Label {
id: topKLabel id: topKLabel
visible: !root.currentModelInfo.isChatGPT visible: !root.currentModelInfo.isChatGPT
text: qsTr("Top K") text: qsTr("Top K:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 2 Layout.row: 2
Layout.column: 2 Layout.column: 2
} }
@ -493,10 +535,12 @@ MySettingsTab {
Accessible.name: topKLabel.text Accessible.name: topKLabel.text
Accessible.description: ToolTip.text Accessible.description: ToolTip.text
} }
MySettingsLabel { Label {
id: maxLengthLabel id: maxLengthLabel
visible: !root.currentModelInfo.isChatGPT visible: !root.currentModelInfo.isChatGPT
text: qsTr("Max Length") text: qsTr("Max Length:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 0 Layout.row: 0
Layout.column: 2 Layout.column: 2
} }
@ -539,10 +583,12 @@ MySettingsTab {
Accessible.description: ToolTip.text Accessible.description: ToolTip.text
} }
MySettingsLabel { Label {
id: batchSizeLabel id: batchSizeLabel
visible: !root.currentModelInfo.isChatGPT visible: !root.currentModelInfo.isChatGPT
text: qsTr("Prompt Batch Size") text: qsTr("Prompt Batch Size:")
font.pixelSize: theme.fontSizeLarge
color: theme.textColor
Layout.row: 1 Layout.row: 1
Layout.column: 0 Layout.column: 0
} }
@ -584,10 +630,12 @@ MySettingsTab {
Accessible.name: batchSizeLabel.text Accessible.name: batchSizeLabel.text
Accessible.description: ToolTip.text Accessible.description: ToolTip.text
} }
MySettingsLabel { Label {
id: repeatPenaltyLabel id: repeatPenaltyLabel
visible: !root.currentModelInfo.isChatGPT visible: !root.currentModelInfo.isChatGPT
text: qsTr("Repeat Penalty") text: qsTr("Repeat Penalty:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 3 Layout.row: 3
Layout.column: 0 Layout.column: 0
} }
@ -629,10 +677,12 @@ MySettingsTab {
Accessible.name: repeatPenaltyLabel.text Accessible.name: repeatPenaltyLabel.text
Accessible.description: ToolTip.text Accessible.description: ToolTip.text
} }
MySettingsLabel { Label {
id: repeatPenaltyTokensLabel id: repeatPenaltyTokensLabel
visible: !root.currentModelInfo.isChatGPT visible: !root.currentModelInfo.isChatGPT
text: qsTr("Repeat Penalty Tokens") text: qsTr("Repeat Penalty Tokens:")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 3 Layout.row: 3
Layout.column: 2 Layout.column: 2
} }
@ -683,8 +733,8 @@ MySettingsTab {
Layout.topMargin: 15 Layout.topMargin: 15
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumWidth: promptTemplate.width Layout.minimumWidth: promptTemplate.width
height: 3 height: 1
color: theme.accentColor color: theme.tabBorder
} }
} }
} }

View File

@ -43,7 +43,7 @@ BusyIndicator {
implicitWidth: 10 implicitWidth: 10
implicitHeight: 10 implicitHeight: 10
radius: 5 radius: 5
color: theme.accentColor color: theme.textAccent
required property int index required property int index

View File

@ -2,35 +2,24 @@ import QtCore
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Controls.Basic import QtQuick.Controls.Basic
import mysettings
Button { Button {
id: myButton id: myButton
padding: 10 padding: 10
rightPadding: 18
leftPadding: 18
property color textColor: theme.oppositeTextColor
property color mutedTextColor: theme.oppositeMutedTextColor
property color backgroundColor: theme.buttonBackground
property color backgroundColorHovered: theme.buttonBackgroundHovered
property real borderWidth: MySettings.chatTheme === "LegacyDark" ? 1 : 0
property color borderColor: theme.buttonBorder
property real fontPixelSize: theme.fontSizeLarge
contentItem: Text { contentItem: Text {
text: myButton.text text: myButton.text
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
color: myButton.enabled ? textColor : mutedTextColor color: myButton.enabled ? theme.textColor : theme.mutedTextColor
font.pixelSize: fontPixelSize font.pixelSize: theme.fontSizeLarge
Accessible.role: Accessible.Button Accessible.role: Accessible.Button
Accessible.name: text Accessible.name: text
} }
background: Rectangle { background: Rectangle {
border.color: myButton.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2
radius: 10 radius: 10
border.width: myButton.borderWidth color: myButton.hovered ? theme.backgroundDark : theme.backgroundDarkest
border.color: myButton.borderColor
color: myButton.hovered ? backgroundColorHovered : backgroundColor
} }
Accessible.role: Accessible.Button Accessible.role: Accessible.Button
Accessible.name: text Accessible.name: text
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
} }

View File

@ -15,17 +15,15 @@ CheckBox {
implicitHeight: 26 implicitHeight: 26
x: myCheckBox.leftPadding x: myCheckBox.leftPadding
y: parent.height / 2 - height / 2 y: parent.height / 2 - height / 2
border.color: theme.checkboxBorder border.color: theme.dialogBorder
color: "transparent" color: "transparent"
radius: 3
Rectangle { Rectangle {
width: 14 width: 14
height: 14 height: 14
x: 6 x: 6
y: 6 y: 6
radius: 2 color: theme.textColor
color: theme.checkboxForeground
visible: myCheckBox.checked visible: myCheckBox.checked
} }
} }
@ -38,5 +36,4 @@ CheckBox {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
leftPadding: myCheckBox.indicator.width + myCheckBox.spacing leftPadding: myCheckBox.indicator.width + myCheckBox.spacing
} }
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
} }

View File

@ -28,7 +28,7 @@ ComboBox {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
background: Rectangle { background: Rectangle {
color: highlighted ? theme.lightContrast : theme.darkContrast color: highlighted ? theme.backgroundLight : theme.backgroundDark
} }
highlighted: comboBox.highlightedIndex === index highlighted: comboBox.highlightedIndex === index
} }
@ -47,7 +47,7 @@ ComboBox {
} }
background: Rectangle { background: Rectangle {
color: theme.black color: theme.backgroundDark
} }
} }
indicator: Canvas { indicator: Canvas {
@ -73,16 +73,13 @@ ComboBox {
context.moveTo(0, height / 2 + 2); context.moveTo(0, height / 2 + 2);
context.lineTo(width / 2, height); context.lineTo(width / 2, height);
context.lineTo(width, height / 2 + 2); context.lineTo(width, height / 2 + 2);
context.strokeStyle = comboBox.pressed ? theme.gray400 : theme.gray300; context.strokeStyle = comboBox.pressed ? theme.textAccent : theme.mutedTextColor;
context.stroke(); context.stroke();
} }
} }
background: Rectangle { background: Rectangle {
color: theme.controlBackground color: theme.backgroundDark
border.width: 1
border.color: theme.controlBorder
radius: 10 radius: 10
} }
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
} }

View File

@ -11,7 +11,7 @@ Dialog {
background: Rectangle { background: Rectangle {
width: parent.width width: parent.width
height: parent.height height: parent.height
color: theme.containerBackground color: theme.backgroundDarkest
border.width: 1 border.width: 1
border.color: theme.dialogBorder border.color: theme.dialogBorder
radius: 10 radius: 10
@ -23,7 +23,7 @@ Dialog {
anchors.centerIn: myCloseButton anchors.centerIn: myCloseButton
width: myCloseButton.width + 10 width: myCloseButton.width + 10
height: myCloseButton.height + 10 height: myCloseButton.height + 10
color: theme.containerBackground color: theme.backgroundDarkest
} }
MyToolButton { MyToolButton {

View File

@ -11,8 +11,7 @@ TextField {
color: text === "" || isValid ? theme.textColor : theme.textErrorColor color: text === "" || isValid ? theme.textColor : theme.textErrorColor
background: Rectangle { background: Rectangle {
implicitWidth: 150 implicitWidth: 150
color: theme.controlBackground color: theme.backgroundDark
radius: 10 radius: 10
} }
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
} }

View File

@ -1,38 +0,0 @@
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
import mysettings
Button {
id: myButton
padding: 10
rightPadding: 18
leftPadding: 18
property color textColor: MySettings.chatTheme === "Dark" ? theme.green800 : theme.green600
property color mutedTextColor: textColor
property color backgroundColor: MySettings.chatTheme === "Dark" ? theme.green400 : theme.green200
property color backgroundColorHovered: theme.green300
property real borderWidth: 0
property color borderColor: "transparent"
property real fontPixelSize: theme.fontSizeLarge
contentItem: Text {
text: myButton.text
horizontalAlignment: Text.AlignHCenter
color: myButton.enabled ? textColor : mutedTextColor
font.pixelSize: fontPixelSize
font.bold: true
Accessible.role: Accessible.Button
Accessible.name: text
}
background: Rectangle {
radius: 10
border.width: borderWidth
border.color: borderColor
color: myButton.hovered ? backgroundColorHovered : backgroundColor
}
Accessible.role: Accessible.Button
Accessible.name: text
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
}

View File

@ -1,38 +0,0 @@
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
import mysettings
Button {
id: myButton
padding: 10
rightPadding: 18
leftPadding: 18
font.pixelSize: theme.fontSizeLarge
property color textColor: MySettings.chatTheme === "Dark" ? theme.red800 : theme.red600
property color mutedTextColor: MySettings.chatTheme === "Dark" ? theme.red400 : theme.red300
property color backgroundColor: enabled ? (MySettings.chatTheme === "Dark" ? theme.red400 : theme.red200) :
(MySettings.chatTheme === "Dark" ? theme.red200 : theme.red100)
property color backgroundColorHovered: enabled ? (MySettings.chatTheme === "Dark" ? theme.red500 : theme.red300) : backgroundColor
property real borderWidth: 0
property color borderColor: "transparent"
contentItem: Text {
text: myButton.text
horizontalAlignment: Text.AlignHCenter
color: myButton.enabled ? textColor : mutedTextColor
font.pixelSize: theme.fontSizeLarge
font.bold: true
Accessible.role: Accessible.Button
Accessible.name: text
}
background: Rectangle {
radius: 10
border.width: borderWidth
border.color: borderColor
color: myButton.hovered ? backgroundColorHovered : backgroundColor
}
Accessible.role: Accessible.Button
Accessible.name: text
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
}

View File

@ -1,10 +0,0 @@
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
Label {
color: theme.settingsTitleTextColor
font.pixelSize: theme.fontSizeSmall
font.bold: true
}

View File

@ -14,38 +14,28 @@ Item {
id: theme id: theme
} }
property alias title: titleLabelText.text property alias title: titleLabel.text
property ListModel tabTitlesModel: ListModel { } property ListModel tabTitlesModel: ListModel { }
property list<Component> tabs: [ ] property list<Component> tabs: [ ]
Rectangle { Label {
id: titleLabel id: titleLabel
anchors.top: parent.top anchors.top: parent.top
anchors.leftMargin: 20 anchors.horizontalCenter: parent.horizontalCenter
anchors.rightMargin: 15 color: theme.textColor
anchors.left: parent.left padding: 10
anchors.right: parent.right font.bold: true
height: titleLabelText.height font.pixelSize: theme.fontSizeLarger
color: "transparent"
Label {
id: titleLabelText
anchors.left: parent.left
color: theme.titleTextColor
topPadding: 10
bottomPadding: 10
font.pixelSize: theme.fontSizeLargest
font.bold: true
}
} }
Rectangle { Rectangle {
anchors.top: titleLabel.bottom anchors.top: titleLabel.bottom
anchors.leftMargin: 20 anchors.leftMargin: 15
anchors.rightMargin: 15 anchors.rightMargin: 15
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: 3 height: 1
color: theme.accentColor color: theme.tabBorder
} }
TabBar { TabBar {
@ -72,6 +62,9 @@ Item {
} }
background: Rectangle { background: Rectangle {
color: "transparent" color: "transparent"
border.width: 1
border.color: tabButton.checked ? theme.tabBorder : "transparent"
radius: 10
} }
Accessible.role: Accessible.Button Accessible.role: Accessible.Button
Accessible.name: model.title Accessible.name: model.title
@ -89,8 +82,16 @@ Item {
anchors.rightMargin: 15 anchors.rightMargin: 15
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: 3 height: 1
color: theme.accentColor color: theme.tabBorder
}
Rectangle {
anchors.fill: parent
color: "transparent"
radius: 10
border.width: 1
border.color: theme.tabBorder
} }
FolderDialog { FolderDialog {

View File

@ -32,19 +32,13 @@ Item {
} }
ScrollView { ScrollView {
id: scrollView
width: parent.width width: parent.width
height: parent.height height: parent.height
topPadding: 15 padding: 15
leftPadding: 5 rightPadding: 20
contentWidth: availableWidth contentWidth: availableWidth
contentHeight: innerColumn.height contentHeight: innerColumn.height
ScrollBar.vertical: ScrollBar { ScrollBar.vertical.policy: ScrollBar.AlwaysOn
parent: scrollView.parent
anchors.top: scrollView.top
anchors.left: scrollView.right
anchors.bottom: scrollView.bottom
}
Theme { Theme {
id: theme id: theme
@ -70,7 +64,7 @@ Item {
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
height: restoreDefaultsButton.height height: restoreDefaultsButton.height
MySettingsButton { MyButton {
id: restoreDefaultsButton id: restoreDefaultsButton
anchors.left: parent.left anchors.left: parent.left
visible: showRestoreDefaultsButton visible: showRestoreDefaultsButton
@ -84,7 +78,7 @@ Item {
root.restoreDefaultsClicked(); root.restoreDefaultsClicked();
} }
} }
MySettingsButton { MyButton {
id: advancedSettingsButton id: advancedSettingsButton
anchors.right: parent.right anchors.right: parent.right
visible: root.advancedSettings && showAdvancedSettingsButton visible: root.advancedSettings && showAdvancedSettingsButton

View File

@ -1,24 +0,0 @@
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
Label {
id: mySlug
padding: 3
rightPadding: 9
leftPadding: 9
font.pixelSize: theme.fontSizeFixedSmall
background: Rectangle {
radius: 6
border.width: 1
border.color: mySlug.color
color: theme.slugBackground
}
ToolTip.visible: ma.containsMouse && ToolTip.text !== ""
MouseArea {
id: ma
anchors.fill: parent
hoverEnabled: true
}
}

View File

@ -1,22 +0,0 @@
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
TextArea {
id: myTextArea
color: enabled ? theme.textColor : theme.mutedTextColor
placeholderTextColor: theme.mutedTextColor
font.pixelSize: theme.fontSizeLarge
background: Rectangle {
implicitWidth: 150
color: theme.controlBackground
border.width: 1
border.color: theme.controlBorder
radius: 10
}
padding: 10
wrapMode: TextArea.Wrap
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
}

View File

@ -6,14 +6,10 @@ import QtQuick.Controls.Basic
TextField { TextField {
id: myTextField id: myTextField
padding: 10 padding: 10
placeholderTextColor: theme.mutedTextColor
background: Rectangle { background: Rectangle {
implicitWidth: 150 implicitWidth: 150
color: myTextField.enabled ? theme.controlBackground : theme.disabledControlBackground color: theme.backgroundDark
border.width: 1
border.color: theme.controlBorder
radius: 10 radius: 10
} }
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval color: theme.textColor
color: enabled ? theme.textColor : theme.mutedTextColor }
}

View File

@ -7,8 +7,6 @@ import Qt5Compat.GraphicalEffects
Button { Button {
id: myButton id: myButton
padding: 10 padding: 10
property color backgroundColor: theme.iconBackgroundDark
property color backgroundColorHovered: theme.iconBackgroundHovered
property bool toggled: false property bool toggled: false
property alias source: image.source property alias source: image.source
property alias fillMode: image.fillMode property alias fillMode: image.fillMode
@ -27,7 +25,7 @@ Button {
anchors.fill: parent anchors.fill: parent
color: "transparent" color: "transparent"
visible: myButton.toggled visible: myButton.toggled
border.color: theme.accentColor border.color: theme.backgroundLightest
border.width: 1 border.width: 1
radius: 10 radius: 10
} }
@ -41,10 +39,9 @@ Button {
ColorOverlay { ColorOverlay {
anchors.fill: image anchors.fill: image
source: image source: image
color: myButton.hovered ? backgroundColorHovered : backgroundColor color: myButton.hovered ? theme.textColor : "transparent"
} }
} }
Accessible.role: Accessible.Button Accessible.role: Accessible.Button
Accessible.name: text Accessible.name: text
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
} }

View File

@ -12,6 +12,7 @@ MyDialog {
id: networkDialog id: networkDialog
anchors.centerIn: parent anchors.centerIn: parent
modal: true modal: true
opacity: 0.9
padding: 20 padding: 20
Theme { Theme {
@ -49,27 +50,43 @@ MyDialog {
ScrollBar.vertical.policy: ScrollBar.AlwaysOn ScrollBar.vertical.policy: ScrollBar.AlwaysOn
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
MyTextArea { TextArea {
id: textOptIn id: textOptIn
wrapMode: Text.Wrap
width: 1024 - 40 width: 1024 - 40
padding: 20
text: qsTr("By enabling this feature, you will be able to participate in the democratic process of training a large language model by contributing data for future model improvements. text: qsTr("By enabling this feature, you will be able to participate in the democratic process of training a large language model by contributing data for future model improvements.
When a GPT4All model responds to you and you have opted-in, your conversation will be sent to the GPT4All Open Source Datalake. Additionally, you can like/dislike its response. If you dislike a response, you can suggest an alternative response. This data will be collected and aggregated in the GPT4All Datalake. When a GPT4All model responds to you and you have opted-in, your conversation will be sent to the GPT4All Open Source Datalake. Additionally, you can like/dislike its response. If you dislike a response, you can suggest an alternative response. This data will be collected and aggregated in the GPT4All Datalake.
NOTE: By turning on this feature, you will be sending your data to the GPT4All Open Source Datalake. You should have no expectation of chat privacy when this feature is enabled. You should; however, have an expectation of an optional attribution if you wish. Your chat data will be openly available for anyone to download and will be used by Nomic AI to improve future GPT4All models. Nomic AI will retain all attribution information attached to your data and you will be credited as a contributor to any GPT4All model release that uses your data!") NOTE: By turning on this feature, you will be sending your data to the GPT4All Open Source Datalake. You should have no expectation of chat privacy when this feature is enabled. You should; however, have an expectation of an optional attribution if you wish. Your chat data will be openly available for anyone to download and will be used by Nomic AI to improve future GPT4All models. Nomic AI will retain all attribution information attached to your data and you will be credited as a contributor to any GPT4All model release that uses your data!")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
focus: false focus: false
readOnly: true readOnly: true
Accessible.role: Accessible.Paragraph Accessible.role: Accessible.Paragraph
Accessible.name: qsTr("Terms for opt-in") Accessible.name: qsTr("Terms for opt-in")
Accessible.description: qsTr("Describes what will happen when you opt-in") Accessible.description: qsTr("Describes what will happen when you opt-in")
background: Rectangle {
color: theme.backgroundLight
radius: 10
}
} }
} }
MyTextField { TextField {
id: attribution id: attribution
color: theme.textColor
padding: 20
width: parent.width width: parent.width
text: MySettings.networkAttribution text: MySettings.networkAttribution
font.pixelSize: theme.fontSizeLarge
placeholderText: qsTr("Please provide a name for attribution (optional)") placeholderText: qsTr("Please provide a name for attribution (optional)")
placeholderTextColor: theme.backgroundLightest
background: Rectangle {
color: theme.backgroundLighter
radius: 10
}
Accessible.role: Accessible.EditableText Accessible.role: Accessible.EditableText
Accessible.name: qsTr("Attribution (optional)") Accessible.name: qsTr("Attribution (optional)")
Accessible.description: qsTr("Provide attribution") Accessible.description: qsTr("Provide attribution")
@ -84,12 +101,12 @@ NOTE: By turning on this feature, you will be sending your data to the GPT4All O
padding: 20 padding: 20
alignment: Qt.AlignRight alignment: Qt.AlignRight
spacing: 10 spacing: 10
MySettingsButton { MyButton {
text: qsTr("Enable") text: qsTr("Enable")
Accessible.description: qsTr("Enable opt-in") Accessible.description: qsTr("Enable opt-in")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
} }
MySettingsButton { MyButton {
text: qsTr("Cancel") text: qsTr("Cancel")
Accessible.description: qsTr("Cancel opt-in") Accessible.description: qsTr("Cancel opt-in")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole DialogButtonBox.buttonRole: DialogButtonBox.RejectRole

View File

@ -31,13 +31,12 @@ MyDialog {
anchors.left: parent.left anchors.left: parent.left
topPadding: 20 topPadding: 20
bottomPadding: 20 bottomPadding: 20
text: qsTr("New version is available") text: qsTr("New version is available:")
color: theme.titleTextColor color: theme.textColor
font.pixelSize: theme.fontSizeLarge font.pixelSize: theme.fontSizeLarge
font.bold: true
} }
MySettingsButton { MyButton {
id: button id: button
anchors.left: label.right anchors.left: label.right
anchors.leftMargin: 10 anchors.leftMargin: 10

View File

@ -7,6 +7,7 @@ import QtQuick.Layouts
Dialog { Dialog {
id: popupDialog id: popupDialog
anchors.centerIn: parent anchors.centerIn: parent
opacity: 0.9
padding: 20 padding: 20
property alias text: textField.text property alias text: textField.text
property bool shouldTimeOut: true property bool shouldTimeOut: true
@ -52,7 +53,7 @@ Dialog {
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
color: theme.containerBackground color: theme.backgroundDarkest
border.width: 1 border.width: 1
border.color: theme.dialogBorder border.color: theme.dialogBorder
radius: 10 radius: 10

View File

@ -41,52 +41,46 @@ MyDialog {
} }
} }
Rectangle { ScrollView {
id: stackList id: stackList
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
width: 220 width: 200
color: theme.controlBackground ScrollBar.vertical.policy: ScrollBar.AsNeeded
radius: 10 clip: true
ScrollView { ListView {
anchors.top: parent.top id: listView
anchors.bottom: parent.bottom anchors.fill: parent
anchors.left: parent.left anchors.rightMargin: 10
anchors.right: parent.right model: stacksModel
anchors.topMargin: 10
ScrollBar.vertical.policy: ScrollBar.AsNeeded
clip: true
ListView { delegate: Rectangle {
id: listView id: item
anchors.fill: parent width: listView.width
model: stacksModel height: titleLabel.height + 25
color: "transparent"
border.color: theme.backgroundLighter
border.width: index == listView.currentIndex ? 1 : 0
radius: 10
delegate: Rectangle { Text {
id: item id: titleLabel
width: listView.width anchors.verticalCenter: parent.verticalCenter
height: titleLabel.height + 10 anchors.left: parent.left
color: "transparent" anchors.margins: 20
font.bold: index == listView.currentIndex
text: title
font.pixelSize: theme.fontSizeLarge
elide: Text.ElideRight
color: theme.textColor
width: 200
}
MyButton { TapHandler {
id: titleLabel onTapped: {
backgroundColor: index === listView.currentIndex ? theme.buttonBackground : theme.controlBackground listView.currentIndex = index
backgroundColorHovered: index === listView.currentIndex ? backgroundColor : theme.containerBackground
borderColor: index === listView.currentIndex ? theme.accentColor : "transparent"
borderWidth: index === listView.currentIndex ? 1 : 0
textColor: index === listView.currentIndex ? theme.oppositeTextColor : theme.titleTextColor
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 10
font.bold: index === listView.currentIndex
text: title
font.pixelSize: theme.fontSizeLarge
onClicked: {
listView.currentIndex = index
}
} }
} }
} }

View File

@ -52,19 +52,27 @@ MyDialog {
ScrollBar.vertical.policy: ScrollBar.AlwaysOn ScrollBar.vertical.policy: ScrollBar.AlwaysOn
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
MyTextArea { TextArea {
id: welcome id: welcome
wrapMode: Text.Wrap
width: 1024 - 40 width: 1024 - 40
padding: 20
textFormat: TextEdit.MarkdownText textFormat: TextEdit.MarkdownText
text: qsTr("### Release notes\n") text: qsTr("### Release notes\n")
+ Download.releaseInfo.notes + Download.releaseInfo.notes
+ qsTr("### Contributors\n") + qsTr("### Contributors\n")
+ Download.releaseInfo.contributors + Download.releaseInfo.contributors
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
focus: false focus: false
readOnly: true readOnly: true
Accessible.role: Accessible.Paragraph Accessible.role: Accessible.Paragraph
Accessible.name: qsTr("Release notes") Accessible.name: qsTr("Release notes")
Accessible.description: qsTr("Release notes for this version") Accessible.description: qsTr("Release notes for this version")
background: Rectangle {
color: theme.backgroundLight
radius: 10
}
} }
} }
@ -75,9 +83,11 @@ MyDialog {
ScrollBar.vertical.policy: ScrollBar.AlwaysOn ScrollBar.vertical.policy: ScrollBar.AlwaysOn
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
MyTextArea { TextArea {
id: optInTerms id: optInTerms
wrapMode: Text.Wrap
width: 1024 - 40 width: 1024 - 40
padding: 20
textFormat: TextEdit.MarkdownText textFormat: TextEdit.MarkdownText
text: qsTr( text: qsTr(
"### Opt-ins for anonymous usage analytics and datalake "### Opt-ins for anonymous usage analytics and datalake
@ -95,11 +105,17 @@ to download and will be used by Nomic AI to improve future GPT4All models. Nomic
attribution information attached to your data and you will be credited as a contributor to any GPT4All attribution information attached to your data and you will be credited as a contributor to any GPT4All
model release that uses your data!") model release that uses your data!")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
focus: false focus: false
readOnly: true readOnly: true
Accessible.role: Accessible.Paragraph Accessible.role: Accessible.Paragraph
Accessible.name: qsTr("Terms for opt-in") Accessible.name: qsTr("Terms for opt-in")
Accessible.description: qsTr("Describes what will happen when you opt-in") Accessible.description: qsTr("Describes what will happen when you opt-in")
background: Rectangle {
color: theme.backgroundLight
radius: 10
}
} }
} }

View File

@ -4,554 +4,24 @@ import QtQuick.Controls.Basic
import mysettings import mysettings
QtObject { QtObject {
property color textColor: MySettings.chatTheme == "Dark" ? "#d1d5db" : "#2e2e34"
// black and white property color textAccent: MySettings.chatTheme == "Dark" ? "#8e8ea0" : "#71717f"
property color black: Qt.hsla(231/360, 0.15, 0.19) property color mutedTextColor: MySettings.chatTheme == "Dark" ? backgroundLightest : "#AFAFB5"
property color white: Qt.hsla(0, 0, 1) property color backgroundDarkest: MySettings.chatTheme == "Dark" ? "#1c1f21" : "#e3e3e5"
property color backgroundDarker: MySettings.chatTheme == "Dark" ? "#1e2123" : "#e0dedc"
// dark mode black and white property color backgroundDark: MySettings.chatTheme == "Dark" ? "#222527" : "#D2D1D5"
property color darkwhite: Qt.hsla(0, 0, 0.85) property color backgroundLight: MySettings.chatTheme == "Dark" ? "#343541" : "#FFFFFF"
property color backgroundLighter: MySettings.chatTheme == "Dark" ? "#444654" : "#F7F7F8"
// gray // FIXME: These are slightly less red than what atlas uses. should resolve diff property color backgroundLightest: MySettings.chatTheme == "Dark" ? "#7d7d8e" : "#82827a"
property color gray0: white property color backgroundAccent: MySettings.chatTheme == "Dark" ? "#40414f" : "#E3E3E6"
property color gray50: Qt.hsla(25/360, 0.05, 0.97) property color buttonBorder: MySettings.chatTheme == "Dark" ? "#565869" : "#a9a9b0"
property color gray100: Qt.hsla(25/360,0.05, 0.95) property color dialogBorder: MySettings.chatTheme == "Dark" ? "#d1d5db" : "#2e2e34"
property color gray200: Qt.hsla(25/360, 0.05, 0.89) property color userColor: MySettings.chatTheme == "Dark" ? "#ec86bf" : "#137382"
property color gray300: Qt.hsla(25/360, 0.05, 0.82) property color linkColor: MySettings.chatTheme == "Dark" ? "#55aaff" : "#aa5500"
property color gray400: Qt.hsla(25/360, 0.05, 0.71) property color tabBorder: MySettings.chatTheme == "Dark" ? backgroundLight : backgroundDark
property color gray500: Qt.hsla(25/360, 0.05, 0.60) property color assistantColor: "#10a37f"
property color gray600: Qt.hsla(25/360, 0.05, 0.51) property color textErrorColor: "red"
property color gray700: Qt.hsla(25/360, 0.05, 0.42) property real fontSizeLarge: MySettings.fontSize == "Small" ? Qt.application.font.pixelSize : MySettings.fontSize == "Medium" ? Qt.application.font.pixelSize + 5 : Qt.application.font.pixelSize + 10
property color gray800: Qt.hsla(25/360, 0.05, 0.35) property real fontSizeLarger: MySettings.fontSize == "Small" ? Qt.application.font.pixelSize + 2 : MySettings.fontSize == "Medium" ? Qt.application.font.pixelSize + 7 : Qt.application.font.pixelSize + 12
property color gray900: Qt.hsla(25/360, 0.05, 0.31)
property color gray950: Qt.hsla(25/360, 0.05, 0.15)
// darkmode
property color darkgray0: Qt.hsla(25/360, 0.05, 0.23)
property color darkgray50: Qt.hsla(25/360, 0.05, 0.21)
property color darkgray100: Qt.hsla(25/360, 0.05, 0.19)
property color darkgray200: Qt.hsla(25/360, 0.05, 0.17)
property color darkgray300: Qt.hsla(25/360, 0.05, 0.15)
property color darkgray400: Qt.hsla(25/360, 0.05, 0.13)
property color darkgray500: Qt.hsla(25/360, 0.05, 0.11)
property color darkgray600: Qt.hsla(25/360, 0.05, 0.09)
property color darkgray700: Qt.hsla(25/360, 0.05, 0.07)
property color darkgray800: Qt.hsla(25/360, 0.05, 0.05)
property color darkgray900: Qt.hsla(25/360, 0.05, 0.03)
property color darkgray950: Qt.hsla(25/360, 0.05, 0.01)
// green
property color green50: Qt.hsla(120/360, 0.18, 0.97)
property color green100: Qt.hsla(120/360, 0.21, 0.93)
property color green200: Qt.hsla(124/360, 0.21, 0.85)
property color green300: Qt.hsla(122/360, 0.20, 0.73)
property color green400: Qt.hsla(122/360, 0.19, 0.58)
property color green500: Qt.hsla(121/360, 0.19, 0.45)
property color green600: Qt.hsla(122/360, 0.20, 0.33)
property color green700: Qt.hsla(122/360, 0.19, 0.29)
property color green800: Qt.hsla(123/360, 0.17, 0.24)
property color green900: Qt.hsla(124/360, 0.17, 0.20)
property color green950: Qt.hsla(125/360, 0.22, 0.10)
// yellow
property color yellow50: Qt.hsla(47/360, 0.90, 0.96)
property color yellow100: Qt.hsla(46/360, 0.89, 0.89)
property color yellow200: Qt.hsla(45/360, 0.90, 0.77)
property color yellow300: Qt.hsla(44/360, 0.90, 0.66)
property color yellow400: Qt.hsla(41/360, 0.89, 0.56)
property color yellow500: Qt.hsla(36/360, 0.85, 0.50)
property color yellow600: Qt.hsla(30/360, 0.87, 0.44)
property color yellow700: Qt.hsla(24/360, 0.84, 0.37)
property color yellow800: Qt.hsla(21/360, 0.76, 0.31)
property color yellow900: Qt.hsla(20/360, 0.72, 0.26)
property color yellow950: Qt.hsla(19/360, 0.86, 0.14)
// red
property color red50: Qt.hsla(0, 0.71, 0.97)
property color red100: Qt.hsla(0, 0.87, 0.94)
property color red200: Qt.hsla(0, 0.89, 0.89)
property color red300: Qt.hsla(0, 0.85, 0.77)
property color red400: Qt.hsla(0, 0.83, 0.71)
property color red500: Qt.hsla(0, 0.76, 0.60)
property color red600: Qt.hsla(0, 0.65, 0.51)
property color red700: Qt.hsla(0, 0.67, 0.42)
property color red800: Qt.hsla(0, 0.63, 0.35)
property color red900: Qt.hsla(0, 0.56, 0.31)
property color red950: Qt.hsla(0, 0.67, 0.15)
// purple // FIXME: These are slightly more uniform than what atlas uses. should resolve diff
property color purple50: Qt.hsla(279/360, 1.0, 0.98)
property color purple100: Qt.hsla(279/360, 1.0, 0.95)
property color purple200: Qt.hsla(279/360, 1.0, 0.91)
property color purple300: Qt.hsla(279/360, 1.0, 0.84)
property color purple400: Qt.hsla(279/360, 1.0, 0.73)
property color purple500: Qt.hsla(279/360, 1.0, 0.63)
property color purple600: Qt.hsla(279/360, 1.0, 0.53)
property color purple700: Qt.hsla(279/360, 1.0, 0.47)
property color purple800: Qt.hsla(279/360, 1.0, 0.39)
property color purple900: Qt.hsla(279/360, 1.0, 0.32)
property color purple950: Qt.hsla(279/360, 1.0, 0.22)
property color blue0: "#d0d5db"
property color blue100: "#8e8ea0"
property color blue200: "#7d7d8e"
property color blue400: "#444654"
property color blue500: "#343541"
property color blue600: "#2c2d37"
property color blue800: "#232628"
property color blue900: "#222527"
property color blue950: "#1c1f21"
property color blue1000: "#0e1011"
property color accentColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue200;
case "Dark":
return yellow300;
default:
return yellow300;
}
}
property color darkContrast: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue500;
case "Dark":
return darkgray100;
default:
return gray100;
}
}
property color lightContrast: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue400;
case "Dark":
return darkgray0;
default:
return gray0;
}
}
property color controlBorder: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue800;
case "Dark":
return darkgray0;
default:
return gray300;
}
}
property color controlBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue950;
case "Dark":
return darkgray100;
default:
return gray100;
}
}
property color disabledControlBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue950;
case "Dark":
return darkgray200;
default:
return gray200;
}
}
property color conversationBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue500;
default:
return containerBackground;
}
}
property color containerForeground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue950;
case "Dark":
return darkgray300;
default:
return gray300;
}
}
property color containerBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue900;
case "Dark":
return darkgray200;
default:
return gray200;
}
}
property color progressForeground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return accentColor;
case "Dark":
return accentColor;
default:
return accentColor;
}
}
property color progressBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue900;
case "Dark":
return green600;
default:
return green600;
}
}
property color checkboxBorder: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return accentColor;
case "Dark":
return gray200;
default:
return gray600;
}
}
property color checkboxForeground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return accentColor;
case "Dark":
return green600;
default:
return green600;
}
}
property color buttonBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue950;
case "Dark":
return green700;
default:
return green700;
}
}
property color buttonBackgroundHovered: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue900;
case "Dark":
return green500;
default:
return green500;
}
}
property color buttonBorder: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return accentColor;
case "Dark":
return yellow200;
default:
return yellow200;
}
}
property color sendButtonBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return accentColor;
case "Dark":
return accentColor;
default:
return accentColor;
}
}
property color sendButtonBackgroundHovered: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue0;
case "Dark":
return darkwhite;
default:
return black;
}
}
property color conversationButtonBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue500;
case "Dark":
return darkgray100;
default:
return gray0;
}
}
property color conversationButtonBackgroundHovered: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue400;
case "Dark":
return darkgray0;
default:
return gray100;
}
}
property color conversationButtonBorder: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return accentColor;
case "Dark":
return yellow200;
default:
return yellow200;
}
}
property color iconBackgroundDark: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue200;
case "Dark":
return green400;
default:
return green400;
}
}
property color iconBackgroundLight: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue200;
case "Dark":
return darkwhite;
default:
return white;
}
}
property color iconBackgroundHovered: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue0;
case "Dark":
return accentColor;
default:
return accentColor;
}
}
property color slugBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue600;
case "Dark":
return darkgray300;
default:
return gray100;
}
}
property color textColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue0;
case "Dark":
return darkwhite;
default:
return black;
}
}
property color mutedTextColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue200;
case "Dark":
return gray400;
default:
return gray600;
}
}
property color oppositeTextColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return white;
case "Dark":
return darkwhite;
default:
return white;
}
}
property color oppositeMutedTextColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return white;
case "Dark":
return darkwhite;
default:
return white;
}
}
property color textAccent: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return accentColor;
case "Dark":
return accentColor;
default:
return accentColor;
}
}
property color textErrorColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return red400;
case "Dark":
return red400;
default:
return red400;
}
}
property color settingsTitleTextColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue100;
case "Dark":
return green400;
default:
return green700;
}
}
property color titleTextColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return purple400;
case "Dark":
return green400;
default:
return green700;
}
}
property color dialogBorder: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return accentColor;
case "Dark":
return darkgray0;
default:
return darkgray0;
}
}
property color linkColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return yellow600;
case "Dark":
return yellow600;
default:
return yellow600;
}
}
property color mainHeader: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue900;
case "Dark":
return green600;
default:
return green600;
}
}
property color mainComboBackground: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue950;
case "Dark":
return green700;
default:
return green700;
}
}
property color sendGlow: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue1000;
case "Dark":
return green950;
default:
return green300;
}
}
property color userColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return blue800;
case "Dark":
return green700;
default:
return green700;
}
}
property color assistantColor: {
switch (MySettings.chatTheme) {
case "LegacyDark":
return purple400;
case "Dark":
return accentColor;
default:
return accentColor;
}
}
property real fontSizeFixedSmall: 16
property real fontSize: Qt.application.font.pixelSize
property real fontSizeSmall: fontSizeLarge - 2
property real fontSizeLarge: MySettings.fontSize === "Small" ?
fontSize : MySettings.fontSize === "Medium" ?
fontSize + 5 : fontSize + 10
property real fontSizeLarger: MySettings.fontSize === "Small" ?
fontSize + 2 : MySettings.fontSize === "Medium" ?
fontSize + 7 : fontSize + 12
property real fontSizeLargest: MySettings.fontSize === "Small" ?
fontSize + 7 : MySettings.fontSize === "Medium" ?
fontSize + 12 : fontSize + 14
} }

View File

@ -10,6 +10,7 @@ import llm
MyDialog { MyDialog {
id: thumbsDownDialog id: thumbsDownDialog
modal: true modal: true
opacity: 0.9
padding: 20 padding: 20
Theme { Theme {
@ -49,9 +50,18 @@ MyDialog {
ScrollBar.vertical.policy: ScrollBar.AlwaysOn ScrollBar.vertical.policy: ScrollBar.AlwaysOn
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
MyTextArea { TextArea {
id: thumbsDownNewResponse id: thumbsDownNewResponse
color: theme.textColor
padding: 20
wrapMode: Text.Wrap
font.pixelSize: theme.fontSizeLarge
placeholderText: qsTr("Please provide a better response...") placeholderText: qsTr("Please provide a better response...")
placeholderTextColor: theme.backgroundLightest
background: Rectangle {
color: theme.backgroundLighter
radius: 10
}
} }
} }
} }
@ -60,13 +70,15 @@ MyDialog {
padding: 20 padding: 20
alignment: Qt.AlignRight alignment: Qt.AlignRight
spacing: 10 spacing: 10
MySettingsButton { MyButton {
text: qsTr("Submit") text: qsTr("Submit")
font.pixelSize: theme.fontSizeLarge
Accessible.description: qsTr("Submits the user's response") Accessible.description: qsTr("Submits the user's response")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
} }
MySettingsButton { MyButton {
text: qsTr("Cancel") text: qsTr("Cancel")
font.pixelSize: theme.fontSizeLarge
Accessible.description: qsTr("Closes the response dialog") Accessible.description: qsTr("Closes the response dialog")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
} }