Skip to content

Commit

Permalink
v0.0.62
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefvand committed Dec 3, 2024
1 parent 15b9150 commit 938d44b
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 22 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

============

## 0.0.62

- Implemented:
- View Menu -> Show All Characters

## 0.0.61

- Implemented:
Expand Down
22 changes: 11 additions & 11 deletions CMakeLists.txt.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 14.0.2, 2024-12-03T13:29:33. -->
<!-- Written by QtCreator 14.0.2, 2024-12-03T15:01:52. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down Expand Up @@ -102,14 +102,14 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}</value>
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_GENERATOR:STRING=Ninja</value>
<value type="QString" key="CMake.Source.Directory">/data/Code/Qt/Notepad--</value>
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/data/Code/Qt/Notepad--/build/Desktop-Debug</value>
Expand Down Expand Up @@ -160,14 +160,14 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}</value>
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_GENERATOR:STRING=Ninja</value>
<value type="QString" key="CMake.Source.Directory">/data/Code/Qt/Notepad--</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/data/Code/Qt/Notepad--/build/Desktop-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
Expand Down
21 changes: 15 additions & 6 deletions src/codeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ CodeEditor::CodeEditor(QWidget *parent)
m_showTabs = Settings::instance()->loadSetting("View", "ShowTabs", "false") == "true";
m_showSpaces = Settings::instance()->loadSetting("View", "ShowSpaces", "false") == "true";
m_showEOL = Settings::instance()->loadSetting("View", "ShowEOL", "false") == "true";
m_showAllCharacters = Settings::instance()->loadSetting("View", "ShowAllCharacters", "false") == "true";
m_tabWidth = Settings::instance()->loadSetting("View", "TabWidth", "4").toInt();

if (m_showAllCharacters) {
m_showTabs = true;
m_showSpaces = true;
m_showEOL = true;
}
}

int CodeEditor::lineNumberAreaWidth() {
Expand Down Expand Up @@ -279,12 +286,14 @@ void CodeEditor::setShowEOL(bool enabled) {
}
}

bool CodeEditor::showTabs() const {
return m_showTabs;
}

bool CodeEditor::showSpaces() const {
return m_showSpaces;
void CodeEditor::setShowAllCharacters(bool enabled) {
if (m_showAllCharacters != enabled) {
m_showAllCharacters = enabled;
m_showTabs = enabled;
m_showSpaces = enabled;
m_showEOL = enabled;
viewport()->update();
}
}

// TODO: Implement in UI
Expand Down
4 changes: 2 additions & 2 deletions src/codeeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class CodeEditor : public QPlainTextEdit {
void setShowTabs(bool enabled);
void setShowSpaces(bool enabled);
void setShowEOL(bool enabled);
bool showTabs() const;
bool showSpaces() const;
void setShowAllCharacters(bool enabled);
void setTabWidth(int width);

protected:
Expand All @@ -51,6 +50,7 @@ private slots:
bool m_showTabs = false;
bool m_showSpaces = false;
bool m_showEOL = false;
bool m_showAllCharacters = false;
int m_tabWidth;
};

Expand Down
12 changes: 10 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,17 @@ void MainWindow::on_actionShow_End_of_Lines_triggered(bool checked)
}
}

void MainWindow::on_actionShow_All_Characters_triggered(bool checked)
{
Settings::instance()->saveSetting("View", "ShowAllCharacters", checked);

for (int i = 0; i < ui->documentsTab->count(); ++i) {
Document *doc = qobject_cast<Document *>(ui->documentsTab->widget(i));
if (doc) {
doc->editor()->setShowAllCharacters(checked);
}
}
}



Expand Down Expand Up @@ -707,5 +717,3 @@ void MainWindow::on_actionAbout_Qt_triggered()
}




2 changes: 2 additions & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ private slots:

void on_actionShow_End_of_Lines_triggered(bool checked);

void on_actionShow_All_Characters_triggered(bool checked);

private:
Ui::MainWindow* ui;
FileOperations* fileOperations;
Expand Down
6 changes: 5 additions & 1 deletion src/mainwindow/mainwindowconfigloader.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "../settings.h"
#include "../mainwindow.h"
#include "../ui_mainwindow.h"
#include "src/ui_mainwindow.h"
#include "mainwindowconfigloader.h"

MainWindowConfigLoader::MainWindowConfigLoader(MainWindow *mainWindow) : m_mainWindow(mainWindow) {}
Expand All @@ -11,6 +10,7 @@ void MainWindowConfigLoader::loadMainWindowConfig() {
m_mainWindow->getUi()->action_Show_Tabs->setChecked(showTabs());
m_mainWindow->getUi()->actionShow_Spaces->setChecked(showSpaces());
m_mainWindow->getUi()->actionShow_End_of_Lines->setChecked(showEOL());
m_mainWindow->getUi()->actionShow_All_Characters->setChecked(showAllCharacters());
}
}

Expand All @@ -26,4 +26,8 @@ bool MainWindowConfigLoader::showEOL() const {
return Settings::instance()->loadSetting("View", "ShowEOL", "false") == true;
}

bool MainWindowConfigLoader::showAllCharacters() const {
return Settings::instance()->loadSetting("View", "ShowAllCharacters", "false") == true;
}


1 change: 1 addition & 0 deletions src/mainwindow/mainwindowconfigloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class MainWindowConfigLoader
bool showTabs() const;
bool showSpaces() const;
bool showEOL() const;
bool showAllCharacters() const;
};

0 comments on commit 938d44b

Please sign in to comment.