aboutsummaryrefslogtreecommitdiff
path: root/src/header.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2022-04-21 10:51:07 -0400
committerYour Name <you@example.com>2022-04-21 10:51:07 -0400
commitb96fa27adbcdedee9e0a2c788bc5604fbaaa60d8 (patch)
tree592397f5e75b086450afbe65e5dfca63bc8f16e5 /src/header.cc
parent97f3b9c202ad675fbcc2af8f0719f3652557453b (diff)
downloadbiblereader-b96fa27adbcdedee9e0a2c788bc5604fbaaa60d8.tar.gz
biblereader-b96fa27adbcdedee9e0a2c788bc5604fbaaa60d8.tar.bz2
biblereader-b96fa27adbcdedee9e0a2c788bc5604fbaaa60d8.zip
Code simplifications
Diffstat (limited to 'src/header.cc')
-rw-r--r--src/header.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/header.cc b/src/header.cc
index d018ad5..b05e0dd 100644
--- a/src/header.cc
+++ b/src/header.cc
@@ -44,6 +44,7 @@ Header::Header(ReaderView *reader, Gtk::Window *window)
Header::~Header() {}
void Header::updateButtons() {
+ reader->refresh();
back.set_sensitive(reader->getChapter() > 1);
forward.set_sensitive(reader->getChapter() < reader->getChapterMax());
if(reader->getBook() == "") {
@@ -96,7 +97,7 @@ void Header::updateMenus() {
swr->add(*boxr);
swr->set_propagate_natural_width(true);
swr->set_min_content_height(300);
- for(int chapter = 1; chapter <= reader->getChapterMax(); chapter++) {
+ for(unsigned int chapter = 1; chapter <= reader->getChapterMax(); chapter++) {
Gtk::Button *item = Gtk::manage(new Gtk::Button(std::to_string(chapter)));
item->set_relief(Gtk::ReliefStyle::RELIEF_NONE);
item->signal_clicked().connect([chapter, this]() {
@@ -159,7 +160,6 @@ void Header::updateMenus() {
item->signal_clicked().connect([version, this]() {
menuMenu.popdown();
libbible::settingsWrite("biblereader::currMod", version);
- this->reader->refresh();
updateButtons();
updateMenus();
showText();
@@ -170,7 +170,6 @@ void Header::updateMenus() {
delVersion->signal_clicked().connect([version, this]() {
menuMenu.popdown();
libbible::uninstallMod(version);
- reader->refresh();
updateButtons();
updateMenus();
});
@@ -180,7 +179,7 @@ void Header::updateMenus() {
hbox->add(*item);
hbox->add(*delVersion);
versionBox->add(*hbox);
- item->set_sensitive(version != reader->getVersion());
+ item->set_sensitive(version != libbible::settingsRead("biblereader::currMod"));
}
Gtk::Button *add = Gtk::manage(new Gtk::Button);
add->set_image_from_icon_name("list-add-symbolic");