Announcement

Collapse
No announcement yet.

KWrite's toolbars revisited

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [CONFIGURATION] KWrite's toolbars revisited

    Two years ago I posted a thread about this, but since the problem still exists in 20.04, I thought I'd try asking again.

    When I configure KWrite's toolbars, the way my choices *look* in settings do not match where they appear on the actual toolbar. Please look at these screenshots.

    Note where the 'close' button is--I've highlighted where I want it to be, i.e., to the right of the green 'refresh' button:

    Click image for larger version

Name:	image_9166.png
Views:	187
Size:	53.6 KB
ID:	659117


    When you access KWrite's toolbar settings, there are two separate entries:

    Click image for larger version  Name:	KWrite_two_toolbars.png Views:	0 Size:	26.5 KB ID:	659115


    The 'close' button is *only* available in the kwrite entry:

    Click image for larger version  Name:	KWrite_KWrite_toolbar.png Views:	0 Size:	58.8 KB ID:	659116


    It is not available in the KatePartView entry:

    Click image for larger version  Name:	KWrite_KPartView_toolbar.png Views:	0 Size:	109.4 KB ID:	659118

    Is there a solution/workaround now to place a toolbar button where you actually want it? Any config file editing/hacks that can accomplish it? Kindly note that this is a tiny, itsy-bitsy problem, not the end of the world, so it's not a big deal if there's no way to fix it!
    Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544


    #2
    You can probably hack it by editing both ~/.local/share/kxmlgui5/katepart/katepartui5.rc and ~/.local/share/kxmlgui5/kwrite/kwriteui5.rc (the Toolbar sections in these files define the buttons in the combined toolbar). You'd probably need to move the close button after all "groups" in kwriteui5.rc...and make sure all the buttons in katepart5ui.rc belong to a group (that is before the close button in kwriteui5.rc).

    If that sounds a bit a messy you could the post the files you have and I could try to fiddle with them to make it happen.

    Comment


      #3
      Thanks for the suggestion, kubicle! I'll take a look at the files you mentioned and see if I can make heads or tails out of tweaking them.
      Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544

      Comment


        #4
        Originally posted by kubicle View Post
        You can probably hack it by editing both ~/.local/share/kxmlgui5/katepart/katepartui5.rc and ~/.local/share/kxmlgui5/kwrite/kwriteui5.rc (the Toolbar sections in these files define the buttons in the combined toolbar). You'd probably need to move the close button after all "groups" in kwriteui5.rc...and make sure all the buttons in katepart5ui.rc belong to a group (that is before the close button in kwriteui5.rc).
        So I took a look at both files, and now I'm confused! You mention editing *both* files, but I don't see anything to do in katepartui5.rc (other than "make sure all the buttons..."). Don't I need to move the 'close' button to katepartui5.rc? And the 'close' button is already after all 'groups' in kwriteui5.rc, at least as I see it.

        If that sounds a bit a messy you could the post the files you have and I could try to fiddle with them to make it happen.
        It's not messy, but since you offered....

        Here's my kwriteui5.rc:

        Code:
        <!DOCTYPE gui>
        <gui name="kwrite" version="17" translationDomain="kxmlgui5">
        <MenuBar alreadyVisited="1">
        <Menu noMerge="1" name="file" alreadyVisited="1">
        <text translationDomain="kwrite">&amp;File</text>
        <Action name="file_new"/>
        <Separator/>
        <Action name="file_open"/>
        <Action name="file_open_recent"/>
        <Separator/>
        <DefineGroup name="save_merge" append="save_merge"/>
        <Separator/>
        <DefineGroup name="revert_merge" append="revert_merge"/>
        <DefineGroup name="print_merge" append="print_merge"/>
        <Separator/>
        <Action name="file_close"/>
        <DefineGroup name="close_merge" append="close_merge"/>
        <Separator/>
        <Action name="file_quit"/>
        </Menu>
        <Menu noMerge="1" name="edit" alreadyVisited="1">
        <text translationDomain="kwrite">&amp;Edit</text>
        <DefineGroup name="edit_undo_merge"/>
        <Separator/>
        <DefineGroup name="edit_paste_merge"/>
        <Separator/>
        <DefineGroup name="edit_select_merge"/>
        <Separator/>
        <DefineGroup name="edit_find_merge"/>
        <Separator/>
        <Merge/>
        </Menu>
        <Menu noMerge="1" name="view" alreadyVisited="1">
        <text translationDomain="kwrite">&amp;View</text>
        <Action name="view_new_view"/>
        <Separator/>
        <DefineGroup name="view_operations"/>
        </Menu>
        <Merge/>
        <Separator weakSeparator="1"/>
        <Separator weakSeparator="1"/>
        <Separator weakSeparator="1"/>
        <Separator weakSeparator="1"/>
        <Separator weakSeparator="1"/>
        <Separator weakSeparator="1"/>
        <Menu noMerge="1" name="tools" alreadyVisited="1">
        <text translationDomain="kwrite">&amp;Tools</text>
        <DefineGroup name="tools_operations"/>
        </Menu>
        <Menu noMerge="1" name="settings" alreadyVisited="1">
        <text translationDomain="kxmlgui5">&amp;Settings</text>
        <DefineGroup name="show_toolbar_merge"/>
        <DefineGroup name="show_merge"/>
        <Action name="options_configure_toolbars"/>
        <Separator weakSeparator="1"/>
        <Action name="options_show_menubar"/>
        <Merge name="StandardToolBarMenuHandler"/>
        <Merge name="KMDIViewActions"/>
        <Action name="options_show_statusbar"/>
        <Action name="set_showPath" append="show_merge"/>
        <Separator weakSeparator="1"/>
        <DefineGroup name="configure_merge" append="save_merge"/>
        <Separator weakSeparator="1"/>
        <Action name="options_configure_keybinding"/>
        <Action name="options_configure_toolbars"/>
        <Action name="settings_configure" append="configure_merge"/>
        </Menu>
        <Separator weakSeparator="1"/>
        <Menu noMerge="1" name="help" alreadyVisited="1">
        <text translationDomain="kxmlgui5">&amp;Help</text>
        <Action name="help_contents"/>
        <Action name="help_whats_this"/>
        <Separator weakSeparator="1"/>
        <Action name="help_report_bug"/>
        <Separator weakSeparator="1"/>
        <Action name="help_donate"/>
        <Separator weakSeparator="1"/>
        <Action name="switch_application_language"/>
        <Separator weakSeparator="1"/>
        <Action name="help_about_editor" append="about_merge"/>
        <Action name="help_about_app"/>
        <Action name="help_about_kde"/>
        </Menu>
        </MenuBar>
        <ToolBar noMerge="1" name="mainToolBar" alreadyVisited="1">
        <text translationDomain="kwrite">Main Toolbar</text>
        <Action name="file_new"/>
        <Action name="file_open"/>
        <Action name="file_open_recent"/>
        <DefineGroup name="file_operations"/>
        <DefineGroup name="print_merge"/>
        <DefineGroup name="edit_operations"/>
        <DefineGroup name="find_operations"/>
        <Separator name="separator_0"/>
        <Action name="file_close"/>
        <DefineGroup name="zoom_operations"/>
        </ToolBar>
        <Menu noMerge="1" name="ktexteditor_popup">
        <DefineGroup name="popup_operations"/>
        </Menu>
        <ActionProperties scheme="Default">
        <Action icon="system-log-out" name="file_close"/>
        </ActionProperties>
        </gui>
        And here's my katepart5ui.rc:

        Code:
        <!DOCTYPE gui>
        <gui name="KatePartView" version="87" translationDomain="ktexteditor5">
        <MenuBar>
        <Menu noMerge="1" name="file">
        <text translationDomain="ktexteditor5">&amp;File</text>
        <Action name="file_save" group="save_merge"/>
        <Action name="file_save_as" group="save_merge"/>
        <Action name="file_save_as_with_encoding" group="save_merge"/>
        <Action name="file_save_copy_as" group="save_merge"/>
        <Action name="file_reload" group="revert_merge"/>
        <Action name="file_print" group="print_merge"/>
        <Action name="file_print_preview" group="print_merge"/>
        <Separator group="print_merge"/>
        <Action name="file_export_html" group="print_merge"/>
        <Separator group="print_merge"/>
        </Menu>
        <Menu noMerge="1" name="edit">
        <text translationDomain="ktexteditor5">&amp;Edit</text>
        <Action name="edit_undo" group="edit_undo_merge"/>
        <Action name="edit_redo" group="edit_undo_merge"/>
        <Separator group="edit_undo_merge"/>
        <Action name="edit_cut" group="edit_paste_merge"/>
        <Action name="edit_copy" group="edit_paste_merge"/>
        <Action name="edit_paste" group="edit_paste_merge"/>
        <Action name="edit_paste_menu" group="edit_paste_merge"/>
        <Separator group="edit_paste_merge"/>
        <Action name="edit_copy_html" group="edit_paste_merge"/>
        <Separator group="edit_paste_merge"/>
        <Action name="edit_select_all" group="edit_select_merge"/>
        <Action name="edit_deselect" group="edit_select_merge"/>
        <Action name="set_verticalSelect" group="edit_select_merge"/>
        <Separator group="edit_select_merge"/>
        <Action name="view_input_modes" group="edit_select_merge"/>
        <Action name="set_insert" group="edit_select_merge"/>
        <Separator group="edit_select_merge"/>
        <Action name="edit_find" group="edit_find_merge"/>
        <Menu noMerge="1" name="edit_find_menu" group="edit_find_merge">
        <text translationDomain="ktexteditor5">Find Variants</text>
        <Action name="edit_find_next" group="edit_find_merge"/>
        <Action name="edit_find_prev" group="edit_find_merge"/>
        <Action name="edit_find_selected" group="edit_find_merge"/>
        <Action name="edit_find_selected_backwards" group="edit_find_merge"/>
        </Menu>
        <Action name="edit_replace" group="edit_find_merge"/>
        <Separator group="edit_find_merge"/>
        <Menu noMerge="1" name="edit_goto" group="edit_goto">
        <text translationDomain="ktexteditor5">Go To</text>
        <Action name="to_matching_bracket" group="edit_goto"/>
        <Action name="select_matching_bracket" group="edit_goto"/>
        <Separator group="edit_goto"/>
        <Action name="modified_line_up" group="edit_goto"/>
        <Action name="modified_line_down" group="edit_goto"/>
        <Separator group="edit_goto"/>
        <Action name="go_goto_line" group="edit_goto"/>
        </Menu>
        </Menu>
        <Menu noMerge="1" name="view">
        <text translationDomain="ktexteditor5">&amp;View</text>
        <Action name="switch_to_cmd_line" group="view_operations"/>
        <Separator group="view_operations"/>
        <Menu noMerge="1" name="view_menu_font_sizes" group="view_operations">
        <text translationDomain="ktexteditor5">Zoom</text>
        <Action name="view_inc_font_sizes" group="view_operations"/>
        <Action name="view_dec_font_sizes" group="view_operations"/>
        <Action name="view_reset_font_sizes" group="view_operations"/>
        </Menu>
        <Separator group="view_operations"/>
        <Action name="view_schemas" group="view_operations"/>
        <Separator group="view_operations"/>
        <Menu noMerge="1" name="view_menu_word_wrap" group="view_operations">
        <text translationDomain="ktexteditor5">Word Wrap</text>
        <Action name="view_dynamic_word_wrap" group="view_operations"/>
        <Action name="dynamic_word_wrap_indicators" group="view_operations"/>
        <Action name="view_static_word_wrap" group="view_operations"/>
        <Action name="view_word_wrap_marker" group="view_operations"/>
        </Menu>
        <Separator group="view_operations"/>
        <Menu noMerge="1" name="view_menu_borders" group="view_operations">
        <text translationDomain="ktexteditor5">Borders</text>
        <Action name="view_border" group="view_operations"/>
        <Action name="view_line_numbers" group="view_operations"/>
        <Action name="view_scrollbar_marks" group="view_operations"/>
        <Action name="view_scrollbar_minimap" group="view_operations"/>
        <Action name="view_scrollbar_minimap_all" group="view_operations"/>
        </Menu>
        <Separator group="view_operations"/>
        <Menu noMerge="1" name="codefolding" group="view_operations">
        <text translationDomain="ktexteditor5">&amp;Code Folding</text>
        <Action name="view_folding_markers" group="view_operations"/>
        <Separator group="view_operations"/>
        <Action name="folding_toggle_current" group="view_operations"/>
        <Action name="folding_toggle_in_current" group="view_operations"/>
        <Action name="folding_expandall" group="view_operations"/>
        <Separator group="view_operations"/>
        <Action name="folding_toplevel" group="view_operations"/>
        <Action name="folding_expandtoplevel" group="view_operations"/>
        </Menu>
        <Separator group="view_operations"/>
        <Action name="view_auto_reload" group="view_operations"/>
        <Action name="view_non_printable_spaces" group="view_operations"/>
        <Action name="view_word_count" group="view_operations"/>
        </Menu>
        <Action name="bookmarks"/>
        <Menu noMerge="1" name="tools">
        <text translationDomain="ktexteditor5">&amp;Tools</text>
        <Action name="tools_toggle_write_lock" group="tools_operations"/>
        <Separator group="tools_operations"/>
        <Action name="tools_mode" group="tools_operations"/>
        <Action name="tools_highlighting" group="tools_operations"/>
        <Action name="tools_indentation" group="tools_operations"/>
        <Action name="set_encoding" group="tools_operations"/>
        <Action name="set_eol" group="tools_operations"/>
        <Action name="add_bom" group="tools_operations"/>
        <Separator group="tools_operations"/>
        <Action name="tools_scripts" group="tools_operations"/>
        <Separator group="tools_operations"/>
        <Action name="tools_invoke_code_completion" group="tools_operations"/>
        <Menu noMerge="1" name="wordcompletion" group="tools_operations">
        <text translationDomain="ktexteditor5">Word Completion</text>
        <Action name="doccomplete_fw"/>
        <Action name="doccomplete_bw"/>
        <Action name="doccomplete_sh"/>
        </Menu>
        <Separator group="tools_operations"/>
        <Menu noMerge="1" name="spelling" group="tools_operations">
        <text translationDomain="ktexteditor5">Spelling</text>
        <Action name="tools_toggle_automatic_spell_checking" group="tools_operations"/>
        <Action name="tools_spelling" group="tools_operations"/>
        <Action name="tools_spelling_from_cursor" group="tools_operations"/>
        <Action name="tools_spelling_selection" group="tools_operations"/>
        <Action name="tools_change_dictionary" group="tools_operations"/>
        <Action name="tools_clear_dictionary_ranges" group="tools_operations"/>
        </Menu>
        <Separator group="tools_operations"/>
        <Action name="tools_cleanIndent" group="tools_operations"/>
        <Action name="tools_align" group="tools_operations"/>
        <Separator group="tools_operations"/>
        <Action name="tools_toggle_comment" group="tools_operations"/>
        <Separator group="tools_operations"/>
        <Action name="tools_uppercase" group="tools_operations"/>
        <Action name="tools_lowercase" group="tools_operations"/>
        <Action name="tools_capitalize" group="tools_operations"/>
        <Separator group="tools_operations"/>
        <Action name="tools_join_lines" group="tools_operations"/>
        <Action name="tools_apply_wordwrap" group="tools_operations"/>
        </Menu>
        <Menu noMerge="1" name="settings">
        <text translationDomain="ktexteditor5">&amp;Settings</text>
        <Action name="set_confdlg" group="configure_merge"/>
        </Menu>
        </MenuBar>
        <Menu noMerge="1" name="ktexteditor_popup">
        <Action name="edit_cut" group="popup_operations"/>
        <Action name="edit_copy" group="popup_operations"/>
        <Action name="edit_paste" group="popup_operations"/>
        <Action name="edit_paste_menu" group="popup_operations"/>
        <Separator group="popup_operations"/>
        <Action name="edit_select_all" group="popup_operations"/>
        <Action name="edit_deselect" group="popup_operations"/>
        <Separator group="popup_operations"/>
        <Action name="spelling_suggestions" group="popup_operations"/>
        <Separator group="popup_operations"/>
        <Action name="bookmarks" group="popup_operations"/>
        <Separator group="popup_operations"/>
        <Action name="tools_create_snippet" group="popup_operations"/>
        <Separator group="popup_operations"/>
        </Menu>
        <ToolBar noMerge="1" name="mainToolBar">
        <text translationDomain="ktexteditor5">Main Toolbar</text>
        <Action name="file_save" group="file_operations"/>
        <Action name="file_save_as" group="file_operations"/>
        <Action name="edit_undo" group="edit_operations"/>
        <Action name="edit_redo" group="edit_operations"/>
        <Separator name="separator_0"/>
        <Action name="edit_cut"/>
        <Action name="edit_copy"/>
        <Action name="edit_paste"/>
        <Spacer name="spacer_0"/>
        <Action name="edit_find"/>
        <Action name="edit_find_next"/>
        <Action name="edit_find_prev"/>
        <Action name="edit_replace"/>
        <Action name="file_reload"/>
        </ToolBar>
        </gui>
        If it can be done, I'm sure it's here in these files, but after a couple of failed attempts, I thought I'd ask for help!
        Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544

        Comment


          #5
          Here would be my suggestions (just the Toolbar sections of each file for clarity):

          kwriteui.rc
          Code:
          <ToolBar noMerge="1" name="mainToolBar" alreadyVisited="1">
             <text translationDomain="kwrite">Main Toolbar</text>
             <Action name="file_new"/>
             <Action name="file_open"/>
             <Action name="file_open_recent"/>
             <DefineGroup name="file_operations"/>
             <DefineGroup name="print_merge"/>
             <DefineGroup name="edit_operations"/>
             <DefineGroup name="find_operations"/>
             <DefineGroup name="zoom_operations"/>
             <Separator name="separator_0"/>
             <Action name="file_close"/>
          </ToolBar>
          (moving action "file_close" after all groups, this shouldn't be strictly necessary in your case as you don't have "zoom_operations" group actions in your katepart toolbar, but doesn't hurt...where to place the separator is your choice)

          katepart5ui.rc
          Code:
          <ToolBar noMerge="1" name="mainToolBar">
             <text translationDomain="ktexteditor5">Main Toolbar</text>
             <Action name="file_save" group="file_operations"/>
             <Action name="file_save_as" group="file_operations"/>
             <Action name="edit_undo" group="edit_operations"/>
             <Action name="edit_redo" group="edit_operations"/>
             <Separator name="separator_0" group="edit_operations"/>
             <Action name="edit_cut" group="edit_operations"/>
             <Action name="edit_copy" group="edit_operations"/>
             <Action name="edit_paste" group="edit_operations"/>
             <Spacer name="spacer_0" group="edit_operations"/>
             <Action name="edit_find" group="find_operations"/>
             <Action name="edit_find_next" group="find_operations"/>
             <Action name="edit_find_prev" group="find_operations"/>
             <Action name="edit_replace" group="find_operations"/>
             <Action name="file_reload" group="find_operations"/>
          </ToolBar>
          (put all elements in the katepart toolbar into a group [used edit_operations and find_operations here]. Since they all now belong in a group that is before "file_close" in kwriteui, the close button will be last in the toolbar)

          Edit, restart kwrite and you should be done.

          Additional notes:
          - AFAIK, katepart doesn't include file_close action, so you can't simply move the action from kwriteui to katepart file.
          - Not sure if some modifications to the toolbar via the GUI will revert your manual edits, so you may wish to keep backups or at least some notes, in case you need to redo manual changes later.

          Comment


            #6
            Originally posted by kubicle View Post
            - Not sure if some modifications to the toolbar via the GUI will revert your manual edits, so you may wish to keep backups or at least some notes, in case you need to redo manual changes later.
            In other words, beware re-entering the rabbit hole you found yourself in the last time you tried getting things to look "just as you want".
            Windows no longer obstructs my view.
            Using Kubuntu Linux since March 23, 2007.
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment


              #7
              Originally posted by Snowhog View Post
              In other words, beware re-entering the rabbit hole you found yourself in the last time you tried getting things to look "just as you want".
              I'm not fully awake yet (haven't had my second cup of coffee), so I haven't actually done anything yet, but had to say this: the *FIRST* thing I do before editing any file is save a copy of it in its original form. Been doing that since 1985 and it's saved my ass numerous times!! It's just second nature to me, and I highly recommend that everyone do the same. My scheme has been to "cp filename_whatever filename_whatever.orig" (although, through the years, I've also used _orig at times and .old and _old, but .orig is my normal choice). That's it. Edit away and never worry about screwing things up! Absolute worst case scenario is having to log in as root (which I always enable) to clean things up, restore sanity, and then log back in normally.
              Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544

              Comment


                #8
                Originally posted by DoYouKubuntu View Post
                ...had to say this: the *FIRST* thing I do before editing any file is save a copy of it in its original form. Been doing that since 1985 and it's saved my ass numerous times!! It's just second nature to me, and I highly recommend that everyone do the same. My scheme has been to "cp filename_whatever filename_whatever.orig" (although, through the years, I've also used _orig at times and .old and _old, but .orig is my normal choice). That's it. Edit away and never worry about screwing things up! Absolute worst case scenario is having to log in as root (which I always enable) to clean things up, restore sanity, and then log back in normally.
                I get my editor to move the old file to a backups directory, with a time stamp added to the file name. Been doing that since the 90s, after spending time on DEC/VMS which versioned files automatically.

                Regards, John Little

                Comment


                  #9
                  Originally posted by kubicle View Post
                  Here would be my suggestions (just the Toolbar sections of each file for clarity):
                  << much quality stuff snipped >>

                  I wish I could give you a thousand likes, kubicle!

                  Take a look at the close button's new location (and icon):

                  Click image for larger version

Name:	KWrite_close_button_moved.png
Views:	140
Size:	65.0 KB
ID:	659196


                  For clarity, I copied/pasted both code snippets from kubicle's post #5 in this thread, saved my changes, closed and restarted KWrite, and that was that!

                  Thank you so much!
                  Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544

                  Comment


                    #10
                    Looks like the Close icon isn't the same as it was before this edit?
                    Windows no longer obstructs my view.
                    Using Kubuntu Linux since March 23, 2007.
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment


                      #11
                      Originally posted by Snowhog View Post
                      Looks like the Close icon isn't the same as it was before this edit?
                      "Take a look at the close button's new location (and icon):"
                      Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544

                      Comment

                      Working...
                      X